diff options
Diffstat (limited to 'src/http/handler/static.zig')
| -rw-r--r-- | src/http/handler/static.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/http/handler/static.zig b/src/http/handler/static.zig new file mode 100644 index 0000000..d53f213 --- /dev/null +++ b/src/http/handler/static.zig @@ -0,0 +1,13 @@ +const Interface = @import("Interface.zig"); +const Context = @import("context.zig").Context; +const Response = @import("../Response.zig"); + +pub fn Static(route: anytype, content: []const u8) Context(route) { + const get = struct { + fn get(_: Context(route).Request) Response { + return .ok(.string(content)); + } + }.get; + + return .{ .get = get }; +} |