jetzig/demo/src/app/views/params.zig
Bob Farrell e3ab49fa5a Refactor Route
Move all route types into a single union and remove leftover junk.

Deprecate view functions that receive a `*jetzig.Data` argument (we will
stay backward-compatible until we have a valid reason to drop support
for legacy view functions - the extra code overhead is pretty minimal).
2024-11-17 15:08:54 +00:00

15 lines
379 B
Zig

const std = @import("std");
const jetzig = @import("jetzig");
pub fn post(request: *jetzig.Request) !jetzig.View {
return request.render(.created);
}
test "post" {
var app = try jetzig.testing.app(std.testing.allocator, @import("routes"));
defer app.deinit();
const response = try app.request(.POST, "/params", .{});
try response.expectStatus(.created);
}