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 GitHub
parent 689da4abea
commit 57370b4e31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,7 @@ Exactly the goals I set out to achieve!
## Most FAQ: ## Most FAQ:
- Q: **Zap doesn't build with Zig master?** - Q: **Zap doesn't build with Zig master?**
- A: See the 0.12.0 branch. An example on how to use it is - 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 [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 branch is not the official master branch of ZAP. Yet. Until zig 0.12.0 is
released. released.
@ -41,15 +41,16 @@ 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`
## 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.
- **Super easy build process**: Zap's `build.zig` now uses the new Zig package - **Super easy build process**: Zap's `build.zig` now uses the new Zig package
manager for its C-dependencies, no git submodules anymore. manager for its C-dependencies, no git submodules anymore.
@ -57,7 +58,7 @@ necessary to show a feature.
- **[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