Update README.md

This commit is contained in:
flopetautschnig 2023-04-24 14:13:48 +02:00 committed by GitHub
parent 2adcceb91b
commit 921a1887c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,10 @@ A simple framework for writing web services in zig.
## Create a simple web app
```zig
usingnamespace @import("zerve");
const zrv = @import("zerve");
const Request = zrv.Request;
const Response = zrv.Response;
const Server = zrv.Server;
const allocator = std.heap.page_allocator;
fn index(req: Request) Response {
@ -28,4 +31,4 @@ pub fn main() !void {
try Server.listen("0.0.0.0", 8080, &rt, allocator);
}
```
```