How best to deploy a WebAssembly app

  • Let's say I can't host a server on my own machine that people can connect to.

    Could I instead deploy a WebAssembly app to another machine by sharing files?
    That is you copy the files to machine M:

    app.html	HTML container
    qtloader.js	JS API for loading Qt apps
    app.js	        JS API for loading Qt apps
    app.wasm    	emscripten app binary

    Then start up a local server on machine M with:

    python3 -m http.server

    But why does that not work? Does the server need emrun installed?
    With a simple Qt helloworld, I get the error message:

    TypeError: NetworkError when attempting to fetch resource.

  • Lifetime Qt Champion


    You need a server that is configured to serve these 4 files. A small nginx should be enough.

  • @SGaist said in How best to deploy a WebAssembly app:


    Thank you!...Am a complete beginner. Just the help I needed! I'll try out nginx or something akin. :)

Log in to reply