srctree

Gregory Mullen parent a65e9e06 ff0700f2
add some additional comments to request-userdata

inlinesplit
examples/request-userdata.zig added: 10, removed: 6, total 4
@@ -1,6 +1,10 @@
//! Reading and validating user input
//! Uses the verse endpoint API creating the struct inline instead of importing
//! this as external endpoint.zig file
 
/// The verse endpoint API is documented in examples/endpoint.zig
const Root = struct {
pub const verse_name = .root;
 
pub const verse_routes = .{
// Using verse.Endpoints will include index() for you
verse.Router.POST("post", post),
@@ -114,12 +118,12 @@ const Root = struct {
;
};
 
const Endpoints = verse.Endpoints(.{
Root,
});
 
pub fn main() !void {
const Endpoints = verse.Endpoints(.{
Root,
});
var endpoints = Endpoints.init(std.heap.page_allocator);
 
endpoints.serve(.{
.mode = .{ .http = .{ .port = 8084 } },
}) catch |err| {