aboutsummaryrefslogtreecommitdiff
path: root/src/routes/login.zig
blob: 29bf37026bab4ff03d2c7c6c8f4be4841c0a44c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const std = @import("std");

pub fn handler(
    request: *std.http.Server.Request,
    allocator: std.mem.Allocator,
) anyerror!void {
    var output = std.Io.Writer.Allocating.init(allocator);
    var stringify = std.json.Stringify { .writer = &output.writer };

    try stringify.write(.{
        .user = "nathan.reiner",
        .name = "Nathan Reiner",
    });

    try output.writer.flush();
    try request.respond(output.written(), .{});
}