Commit 1a30b240 authored by mara's avatar mara
Browse files

Remove content type hack

Ship a trivial python web server for debugging, that sends correct mime type
for wasm so that the `delete ...` is no longer needed.
parent 1d2ec686
......@@ -3,4 +3,4 @@ set -ex
cd dist
python3 -m http.server 8080
#!/usr/bin/env python3
'''Extrememly basic webserver, which sends wasm content type properly.'''
# based on
import http.server
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserver
PORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map = {
'.manifest': 'text/cache-manifest',
'.html': 'text/html',
'.png': 'image/png',
'.jpg': 'image/jpg',
'.svg': 'image/svg+xml',
'.css': 'text/css',
'.js': 'application/x-javascript',
'.wasm': 'application/wasm',
'': 'application/octet-stream', # Default
httpd = socketserver.TCPServer(("", PORT), Handler)
print("serving at port", PORT)
......@@ -48,7 +48,6 @@
<canvas id="game-of-life-canvas" title="Universe-visualization
(click cell to toggle)"></canvas>
<script>delete WebAssembly.instantiateStreaming; /* work around issue with file: URLs and mime types */ </script>
<script src="./wasm_game_of_life.js"></script>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment