Created
November 8, 2018 00:44
-
-
Save prideout/09af26cef84eef3e06a1e3f20a499a48 to your computer and use it in GitHub Desktop.
Python WASM server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import http.server | |
import socketserver | |
PORT = 8000 | |
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks mate, those application/wasm errors are really annoying.