mirror of
https://github.com/jetzig-framework/jetzig.git
synced 2025-05-14 22:16:08 +00:00

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).
15 lines
379 B
Zig
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);
|
|
}
|