1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-21 15:44:10 +00:00

minor simple_router fixes

This commit is contained in:
Rene Schallner 2024-01-24 22:58:19 +01:00
parent cccee2b14c
commit bd1fbaee80
2 changed files with 8 additions and 3 deletions

View file

@ -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` - run it like this: `ZAP_USE_OPENSSL=true zig build run-https`
OR like this: `zig build -Dopenssl=true run-https` OR like this: `zig build -Dopenssl=true run-https`
- it will tell you how to generate certificates - it will tell you how to generate certificates
- [**Router support**](examples/simple_router/simple_router.zig): You can now use - [**simple_router**](examples/simple_router/simple_router.zig): See how you
simple router by path. Also example with self capture helper func. 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 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 to a point where I can use it as the JSON REST API backend for real research
projects, serving thousands of concurrent clients. projects, serving thousands of concurrent clients.

View file

@ -103,6 +103,8 @@ pub fn main() !void {
// start worker threads // start worker threads
zap.start(.{ zap.start(.{
.threads = 2, .threads = 2,
.workers = 2,
// Must be 1 if state is shared
.workers = 1,
}); });
} }