1
0
mirror of https://github.com/thib8956/tic-tac-toe-ws.git synced 2024-11-17 01:16:33 +00:00
tic-tac-toe-ws/serve.py
2024-09-02 22:35:04 +02:00

12 lines
315 B
Python

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)