Add a zig webserver#139
Conversation
…ttpFileServer) rather than rely on emrun.py Generates an index.html with links to all built samples
|
Heh, nice. I wonder if we should merge this: ...into an 'all-in-one-step' like this (couldn't come up with a better step-name)... E.g. this would build the examples for wasm32-emscripten and the web server for the host platform and then run server with zig-out/web -p 8000... |
…ds all wasm examples and serves on localhost:8000
|
Oki thanks! It might take a few days until I get around to merging, most likely Monday. |
|
There seems to be some chicken-egg-situation now when running ...maybe a missing dependency between building the examples and starting the web server? |
…les, then serve using native web server. This would potentially allow for a different target for the examples, so makes sense - though a longer command.
|
I've split things up, so that the main -
|
|
Oki doki, I'll give it another whirl 'soon-ish' (not today though). |
|
Building the examples and serve-wasm targets works for me. |
|
Hmm same problem also when running In general I'd like to move some things out of the sokol-zig project because the actual bindings would not require the emsdk and sokol-shdc dependencies, but I think the only realistic way is to move the examples into a separate build.zig and build.zig.zon, maybe even a separate github repo... but I haven't made up my mind yet :) |

I'm not sure whether this is useful to others, but offering a PR just in case.
I've added a pure Zig static webserver to serve files generated by the wasm examples, including an index.html with a list to pick from, rather than relying on emrun.py to serve a single example.