diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-08-03 17:07:05 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-08-03 17:07:05 +0200 |
| commit | 0bc6d195195d1e126b535554a4a4105468cd06d9 (patch) | |
| tree | 6a3288e56bd306db499e597fc53762d05a7c3b82 /src/api | |
| parent | 77642e5081b4ed2516dc08b3ef611c3c444ec6c5 (diff) | |
add tokenizer for whitespaces in js
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/hello-json.zig | 2 | ||||
| -rw-r--r-- | src/api/hello-param.zig | 4 | ||||
| -rw-r--r-- | src/api/root.zig | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/api/hello-json.zig b/src/api/hello-json.zig index 6c29ba7..12f1e72 100644 --- a/src/api/hello-json.zig +++ b/src/api/hello-json.zig @@ -2,7 +2,7 @@ const http = @import("http"); const Context = http.handler.Context; const Response = http.Response; -const Ctx = Context(.{ "hello-json" }); +const Ctx = Context(.{"hello-json"}); pub const ctx: Ctx = .{ .get = get, }; diff --git a/src/api/hello-param.zig b/src/api/hello-param.zig index f4de1dd..b67212b 100644 --- a/src/api/hello-param.zig +++ b/src/api/hello-param.zig @@ -10,5 +10,7 @@ pub const ctx: Ctx = .{ fn get(request: Ctx.Request) Response { const value = request.params.value.as(usize) catch return .badRequest(.string("parameter needs to be an int")); - return .okOrError(.json(request.arena, .{ .value = value, })); + return .okOrError(.json(request.arena, .{ + .value = value, + })); } diff --git a/src/api/root.zig b/src/api/root.zig index 7570a76..2a54b91 100644 --- a/src/api/root.zig +++ b/src/api/root.zig @@ -16,7 +16,7 @@ pub const interfaces: []const Interface = ifs: { var ifs: []const Interface = &.{}; for (modules) |module| { - const interface: []const Interface = &.{ module.ctx.interface() }; + const interface: []const Interface = &.{module.ctx.interface()}; ifs = ifs ++ interface; } |