diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-05-23 07:11:00 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-05-23 07:11:00 +0200 |
| commit | f109fb62b7e45d54b0c9f524a0707f3c2688b6cb (patch) | |
| tree | e539196b2b97fc3e8f11837c4638288b8494ff80 /src/api/sketch.zig | |
| parent | 79ba17323c33c7e7e6b4b3ef526db85f1cf9c086 (diff) | |
add api sketch
Diffstat (limited to 'src/api/sketch.zig')
| -rw-r--r-- | src/api/sketch.zig | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/api/sketch.zig b/src/api/sketch.zig new file mode 100644 index 0000000..409606f --- /dev/null +++ b/src/api/sketch.zig @@ -0,0 +1,29 @@ +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()); +} |