diff options
Diffstat (limited to 'src/routes/root.zig')
| -rw-r--r-- | src/routes/root.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/routes/root.zig b/src/routes/root.zig new file mode 100644 index 0000000..0330404 --- /dev/null +++ b/src/routes/root.zig @@ -0,0 +1,15 @@ +const std = @import("std"); + +pub const fallback = @import("fallback.zig"); + +pub const Handler = *const fn ( + request: *std.http.Server.Request, + allocator: std.mem.Allocator, +) anyerror!void; + +pub const handlers = std.StaticStringMap(Handler).initComptime(.{ +}); + +pub fn get(path: []const u8) Handler { + return handlers.get(path) orelse fallback.handler; +} |