mix popcorn.dev_server (Popcorn v0.1.0)

View Source

Generates a static file server script with code reloading.

The dev server is more complicated than the simple server as sets up a filesystem watcher and reloads the browser window when the popcorn bundle changes.

It requires the following line in the index.html:

<script type="text/javascript" src="/app.js"></script>

These assets can also be hosted with any other server, but it has to add the following HTTP headers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Otherwise the browser refuses to run WASM.