From 8001b02547ba6261682a6d6990157293b23e18d7 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 5 Jun 2026 19:28:56 +0200 Subject: http add request and context --- src/api/root.zig | 2 -- src/api/sketch.zig | 29 ----------------------------- 2 files changed, 31 deletions(-) delete mode 100644 src/api/sketch.zig (limited to 'src/api') 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()); -} -- cgit v1.2.3-70-g09d2