aboutsummaryrefslogtreecommitdiff
path: root/src/routes/root.zig
blob: 0330404ba290c4ea8fc74d9e1c8525b8e62210a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;
}