-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Description
Then python -m http.server is suitable for experimenting with WASM/Emscripten projects. Currently people need to roll their own scripts like https://github.com/python/cpython/blob/main/Tools/wasm/wasm_webserver.py
Here are the default extensions_map (btw could include text/html, text/javascript, text/xml, text/json or other popular extensions for debugging very simple static web app projects):
Lines 661 to 666 in a1a3193
| extensions_map = _encodings_map_default = { | |
| '.gz': 'application/gzip', | |
| '.Z': 'application/octet-stream', | |
| '.bz2': 'application/x-bzip2', | |
| '.xz': 'application/x-xz', | |
| } |
Adding MIME for .data by default is also nice for this is a file extension of Emscripten file system data packages.
It would also be nice if the default http server can be made multi-threaded, because in some rare circumstances it can block Emscripten data package loading. I rolled my own server https://gist.github.com/vadimkantorov/a8c3aca556824df061e84b1d10edee44 which also was serving ETag / HTTP 304 properly.
At least it would be nice to support customizing extensions_map in http.server command line, so that one can call python -m http.server --map-mime .wasm:application/wasm --map-mime .data:application/octet-stream --serve-permanent-etag