diff --git a/README.md b/README.md index 9463412..41fa053 100644 --- a/README.md +++ b/README.md @@ -132,8 +132,11 @@ port and docs dir: `zig build docserver && zig-out/bin/docserver --port=8989 - run it like this: `ZAP_USE_OPENSSL=true zig build run-https` OR like this: `zig build -Dopenssl=true run-https` - it will tell you how to generate certificates -- [**Router support**](examples/simple_router/simple_router.zig): You can now use - simple router by path. Also example with self capture helper func. +- [**simple_router**](examples/simple_router/simple_router.zig): See how you + can use `zap.Router` to dispatch to handlers by HTTP path. It also features + `zap.RequestHandler` to capture the "self" pointer of the container of the + handler functions. + I'll continue wrapping more of facil.io's functionality and adding stuff to zap to a point where I can use it as the JSON REST API backend for real research projects, serving thousands of concurrent clients. diff --git a/examples/simple_router/simple_router.zig b/examples/simple_router/simple_router.zig index 4821646..acff407 100644 --- a/examples/simple_router/simple_router.zig +++ b/examples/simple_router/simple_router.zig @@ -103,6 +103,8 @@ pub fn main() !void { // start worker threads zap.start(.{ .threads = 2, - .workers = 2, + + // Must be 1 if state is shared + .workers = 1, }); }