mirror of
https://github.com/zigzap/zap.git
synced 2025-10-20 23:24:09 +00:00
minor simple_router fixes
This commit is contained in:
parent
b56b64f637
commit
02449e01ff
2 changed files with 8 additions and 3 deletions
|
@ -128,8 +128,11 @@ what's necessary to show a feature.
|
|||
- 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.
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue