mirror of
https://github.com/thib8956/tic-tac-toe-ws.git
synced 2026-03-24 14:37:56 +00:00
fix: improve npm scripts and fix localhost detection
This commit is contained in:
8
serve.py
8
serve.py
@@ -1,11 +1,7 @@
|
||||
import http.server
|
||||
from functools import partial
|
||||
|
||||
HandlerClass = http.server.SimpleHTTPRequestHandler
|
||||
|
||||
# Patch in the correct extensions
|
||||
HandlerClass.extensions_map['.js'] = 'text/javascript'
|
||||
HandlerClass.extensions_map['.mjs'] = 'text/javascript'
|
||||
|
||||
HandlerClass = partial(http.server.SimpleHTTPRequestHandler, directory="dist/")
|
||||
# Run the server (like `python -m http.server` does)
|
||||
http.server.test(HandlerClass, port=8000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user