aboutsummaryrefslogtreecommitdiff
path: root/src/http/handler/static.zig
blob: d53f213bad67a46cc72d861942993c884903dcb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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 };
}