Update README.md
This commit is contained in:
parent
2adcceb91b
commit
921a1887c4
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
```
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue