blob: 7c96c29760e3c49935edbfde5c36f955014f901b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
const http = @import("http");
const Context = http.handler.Context;
const Response = http.Response;
const Ctx = Context(.{ "hello-json" });
pub const ctx: Ctx = .{
.get = get,
};
fn get(request: Ctx.Request) Response {
return .ok_or_error(.json(request.arena, .{
.value = 42,
.message = "Hello, Json!",
}));
}
|