From 1d6e34388d9d792fd184c8b9e0fb11fb9b7e14f9 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 6 Jun 2026 10:35:14 +0200 Subject: api: add example implementations --- src/api/root.zig | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/api/root.zig') 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()); -- cgit v1.2.3-70-g09d2