diff options
Diffstat (limited to 'src/api/root.zig')
| -rw-r--r-- | src/api/root.zig | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/api/root.zig b/src/api/root.zig index 7acd953..7570a76 100644 --- a/src/api/root.zig +++ b/src/api/root.zig @@ -6,7 +6,22 @@ const std = @import("std"); const http = @import("http"); const Interface = http.handler.Interface; -pub const interfaces: []const 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()); |