WIP: The MuSiCaL Update #1
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
nul
|
||||
package-lock.json
|
||||
23
serve.py
Normal file
23
serve.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Simple HTTP server for testing - runs in background"""
|
||||
import http.server
|
||||
import socketserver
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
PORT = 8080
|
||||
|
||||
class Handler(http.server.SimpleHTTPRequestHandler):
|
||||
def log_message(self, format, *args):
|
||||
pass # Suppress logging
|
||||
|
||||
def end_headers(self):
|
||||
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate')
|
||||
self.send_header('Expires', '0')
|
||||
super().end_headers()
|
||||
|
||||
if __name__ == "__main__":
|
||||
with socketserver.TCPServer(("", PORT), Handler) as httpd:
|
||||
print(f"Server running at http://localhost:{PORT}")
|
||||
sys.stdout.flush()
|
||||
httpd.serve_forever()
|
||||
28
test.py
Normal file
28
test.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
# Simple HTTP Test Server
|
||||
# Run: python test.py [port]
|
||||
import http.server
|
||||
import socketserver
|
||||
|
||||
def main():
|
||||
PORT = int(sys.argv[1]) if len(sys.argv) > 1 else 8080
|
||||
print(f"Serving at http://localhost:{PORT}")
|
||||
print("Test pages:")
|
||||
print(" /test-bgm.html - BGM.js song title test")
|
||||
print()
|
||||
print("Available files at:")
|
||||
print(" /index.html")
|
||||
print(" /Music/bgm.js")
|
||||
print()
|
||||
|
||||
handler = http.server.SimpleHTTPRequestHandler
|
||||
httpd = socketserver.TCPServer(("", PORT), handler)
|
||||
|
||||
try:
|
||||
httpd.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
print("\nStopped.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
main()
|
||||
Reference in New Issue
Block a user