mach/tools/wasmserve
Stephen Gutekanst a750e31d11 Revert "all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)"
This reverts commit a1fe671db8.

Lue suggested reverting #661 because ZLS worked around the issue of @src
being relative in that environment: https://github.com/zigtools/zls/pull/898

This is not a perfect solution (what zls did seems to be a workaround), but
is good enough for us until Zig gets an official package manager.
2023-01-10 01:57:52 -07:00
..
test {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
www {build,wasmserve}: improvements 2022-09-15 07:42:59 -07:00
.gitattributes {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
.gitignore {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
build.zig {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
LICENSE {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
LICENSE-APACHE {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
LICENSE-MIT {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
mime.zig {build,wasmserve}: show error on browser + improvements 2022-09-14 12:32:03 -07:00
README.md {build,wasmserve}: use wasmserve, drop apple_pie 2022-09-14 12:32:03 -07:00
wasmserve.zig Revert "all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)" 2023-01-10 01:57:52 -07:00

mach/wasmserve

Small web server specifically for serving Zig WASM applications in development

Getting started

Adding dependency

In a libs subdirectory of the root of your project:

git clone https://github.com/machlibs/wasmserve

Then in your build.zig add:

...
const wasmserve = @import("libs/wasmserve/wasmserve.zig");

pub fn build(b: *Builder) void {
    ...
    const serve_step = try wasmserve.serve(exe, .{ .watch_paths = &.{"src/main.zig"} });
    const run_step = b.step("run", "Run development web server");
    run_step.dependOn(&serve_step.step);
}

Join the community

Join the Mach community on Discord or Matrix to discuss this project, ask questions, get help, etc.