summaryrefslogtreecommitdiff
path: root/site/test.py
diff options
context:
space:
mode:
authorstuebinm2021-04-04 15:33:20 +0200
committerstuebinm2021-04-04 15:33:20 +0200
commit564ab9056268e05621ceb4878ba3b3683abeaf10 (patch)
tree11b23e9ca5de87cc6a27feeed80e4822c13abc2e /site/test.py
parent198a580292ee6b1d15d4c7409bd84ca8e57c9ef2 (diff)
simple python server for testing purposes
web assembly needs its own mimetype set to work in the browser, which most other development tools don't support — so this python script can be used instead.
Diffstat (limited to '')
-rw-r--r--site/test.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/site/test.py b/site/test.py
new file mode 100644
index 0000000..eb69636
--- /dev/null
+++ b/site/test.py
@@ -0,0 +1,15 @@
+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()