diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-06-05 19:28:56 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-06-05 19:28:56 +0200 |
| commit | 8001b02547ba6261682a6d6990157293b23e18d7 (patch) | |
| tree | ee0f7c130a0319e47a677ae24ac66765014507f1 /src/api | |
| parent | 44051e51f99fe7e94f37d567d621fa13399c17f1 (diff) | |
http add request and context
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/root.zig | 2 | ||||
| -rw-r--r-- | src/api/sketch.zig | 29 |
2 files changed, 0 insertions, 31 deletions
diff --git a/src/api/root.zig b/src/api/root.zig index c28991c..5128aa1 100644 --- a/src/api/root.zig +++ b/src/api/root.zig @@ -3,8 +3,6 @@ const std = @import("std"); -pub const _ = @import("sketch.zig"); - test { _ = std.testing.refAllDecls(@This()); } diff --git a/src/api/sketch.zig b/src/api/sketch.zig deleted file mode 100644 index 409606f..0000000 --- a/src/api/sketch.zig +++ /dev/null @@ -1,29 +0,0 @@ -const std = @import("std"); -const http = @import("http"); - -pub const Url = http.Url.Template( - "/api/images/{id}/metadata/{name}", - .{ - .guard = Auth(.admin), - } -); - -const Query = struct { - condition: []const u8, - start: usize, - end: usize, -} - -pub fn post(request: http.Request(Url)) !http.Response { - const query = try request.body.json(Query, request.arena); - - return .string(request.params.id); -} - -pub fn get(request: http.Request(Url)) !http.Response { - return .file("./some/path.txt"); -} - -test { - _ = std.testing.refAllDecls(@This()); -} |