wasm-demo/pkg/srv.py

18 lines
401 B
Python
Executable File

#!/usr/bin/env python3
import http.server
import socketserver
PORT = 21345
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map.update({
'.wasm': 'application/wasm',
})
socketserver.TCPServer.allow_reuse_address = True
with socketserver.TCPServer(("", PORT), Handler) as httpd:
httpd.allow_reuse_address = True
print("serving at port", PORT)
httpd.serve_forever()