1
0
mirror of https://github.com/thib8956/tic-tac-toe-ws.git synced 2024-11-17 09:26:33 +00:00
tic-tac-toe-ws/serve.py

12 lines
315 B
Python
Raw Permalink Normal View History

2024-09-02 20:34:24 +00:00
import http.server
HandlerClass = http.server.SimpleHTTPRequestHandler
# Patch in the correct extensions
HandlerClass.extensions_map['.js'] = 'text/javascript'
HandlerClass.extensions_map['.mjs'] = 'text/javascript'
# Run the server (like `python -m http.server` does)
http.server.test(HandlerClass, port=8000)