diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-06-06 10:35:14 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-06-06 10:35:14 +0200 |
| commit | 1d6e34388d9d792fd184c8b9e0fb11fb9b7e14f9 (patch) | |
| tree | 2eaaf5077c604c79a359037c772f99bb83839545 /src/api/root.zig | |
| parent | f39dfd01ab06cf92a3bcad75fcb175a8242ec1b1 (diff) | |
api: add example implementations
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()); |