Skip to content

Instantly share code, notes, and snippets.

@phorward
Created December 16, 2019 14:38
Show Gist options
  • Save phorward/02cc6f73eff06c8e8397ebb34f98e7dc to your computer and use it in GitHub Desktop.
Save phorward/02cc6f73eff06c8e8397ebb34f98e7dc to your computer and use it in GitHub Desktop.
Pyodide server configuration to correctly serve application/wasm
# Apache Web Server
RewriteEngine off
Options -ExecCGI +Indexes
IndexOrderDefault Descending Date
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods GET
<FilesMatch "\.py$">
Options +Indexes -ExecCGI -Multiviews
Order allow,deny
Allow from all
RemoveHandler .py
AddType text/plain .py
</FilesMatch>
<FilesMatch "\.data$">
Options +Indexes -ExecCGI -Multiviews
Order allow,deny
Allow from all
RemoveHandler .data
AddType application/octet-stream .data
</FilesMatch>
<FilesMatch "\.wasm$">
Options +Indexes -ExecCGI -Multiviews
Order allow,deny
Allow from all
RemoveHandler .wasm
AddType application/wasm .wasm
</FilesMatch>
# Google App Engine
runtime: python27
api_version: 1
handlers:
- url: /myapp/s/(.*\.wasm)$
static_files: myapp/\1
upload: myapp/.*\.wasm$
mime_type: application/wasm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment