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

Update README.md

This commit is contained in:
Rene Schallner 2024-01-07 21:12:01 +01:00 committed by Rene Schallner
parent 2574ceb63c
commit 5a284fc96d

View file

@ -28,6 +28,11 @@ Exactly the goals I set out to achieve!
## Most FAQ: ## Most FAQ:
- Q: **Zap doesn't build with Zig master?**
- A: See the 0.12.0 branch. An example of how to use it is
[here](https://github.com/zigzap/hello-0.12.0). Please note that the 0.12.0
branch is not the official master branch of ZAP. Yet. Until zig 0.12.0 is
released.
- Q: **Does ZAP work on Windows?** - Q: **Does ZAP work on Windows?**
- A: No. This is due to the underlying facil.io C library. Future versions of - A: No. This is due to the underlying facil.io C library. Future versions of
facil.io might support Windows but there is no timeline yet. Your best options facil.io might support Windows but there is no timeline yet. Your best options
@ -35,17 +40,18 @@ Exactly the goals I set out to achieve!
- Q: **Does ZAP support TLS / HTTPS?** - Q: **Does ZAP support TLS / HTTPS?**
- A: Yes, ZAP supports using the system's openssl. See the - A: Yes, ZAP supports using the system's openssl. See the
[https](./examples/https/https.zig) example and make sure to build with [https](./examples/https/https.zig) example and make sure to build with
the -Dopenssl flag or the environment variable `ZAP_USE_OPENSSL=true`: the `-Dopenssl` flag or the environment variable `ZAP_USE_OPENSSL=true`:
- `.openssl = true,` (in build.zig, `b.dependency("zap" .{...})`) - `.openssl = true,` (in dependent projects' build.zig, `b.dependency("zap" .{...})`)
- `ZAP_USE_OPENSSL=true zig build https` - `ZAP_USE_OPENSSL=true zig build https`
- `zig build -Dopenssl=true https`
- Q: **Are there API docs?** - Q: **Are there API docs?**
- A: They are under development. Git clone this, then run `zig build run-docserver`. - A: They are under development. Git clone this, then run `zig build run-docserver`.
## Here's what works ## Here's what works
I recommend checking out **Endpoint-based examples for more realistic I recommend checking out **Endpoint-based examples for more realistic
use-cases**. Most of examples are super-stripped-down to only include what's use cases**. Most of the examples are super stripped down to only include
necessary to show a feature. what's necessary to show a feature.
**NOTE: To see API docs, run `zig build run-docserver`.** To specify a custom **NOTE: To see API docs, run `zig build run-docserver`.** To specify a custom
port and docs dir: `zig build docserver && zig-out/bin/docserver --port=8989 port and docs dir: `zig build docserver && zig-out/bin/docserver --port=8989
@ -57,7 +63,7 @@ port and docs dir: `zig build docserver && zig-out/bin/docserver --port=8989
- **[hello](examples/hello/hello.zig)**: welcomes you with some static HTML - **[hello](examples/hello/hello.zig)**: welcomes you with some static HTML
- **[routes](examples/routes/routes.zig)**: a super easy example dispatching on - **[routes](examples/routes/routes.zig)**: a super easy example dispatching on
the HTTP path. **NOTE**: The dispatch in the example is a super-basic the HTTP path. **NOTE**: The dispatch in the example is a super-basic
DIY-style dispatch. See endpoint-based examples for more realistic use-cases. DIY-style dispatch. See endpoint-based examples for more realistic use cases.
- **[serve](examples/serve/serve.zig)**: the traditional static web server with - **[serve](examples/serve/serve.zig)**: the traditional static web server with
optional dynamic request handling optional dynamic request handling
- **[sendfile](examples/sendfile/sendfile.zig)**: simple example of how to send - **[sendfile](examples/sendfile/sendfile.zig)**: simple example of how to send