aboutsummaryrefslogtreecommitdiff
path: root/src/api/root.zig
blob: 7570a7613d6d849623b4e4f0ac53fd5b7f4d7673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! There should not be any http specific stuff in here,
//! only the specific api endpoints.

const std = @import("std");

const http = @import("http");
const Interface = http.handler.Interface;

const modules = .{
    @import("hello-json.zig"),
    @import("hello-param.zig"),
    @import("hello-body.zig"),
};

pub const interfaces: []const Interface = ifs: {
    var ifs: []const Interface = &.{};

    for (modules) |module| {
        const interface: []const Interface = &.{ module.ctx.interface() };
        ifs = ifs ++ interface;
    }

    break :ifs ifs;
};

test {
    _ = std.testing.refAllDecls(@This());
}