srctree

Gregory Mullen parent 0d420b1f f3b8e74c
add send raw slice to context

some internal pages will load their data at comptime, and we just send a raw array of bytes for internally routed calls. See router.zig in next commit
src/context.zig added: 4, removed: 1, total 3
@@ -122,6 +122,9 @@ pub fn sendTemplate(ctx: *Context, t: *Template.Template) Error!void {
defer ctx.alloc.free(page_compiled);
ctx.response.send(page_compiled) catch unreachable;
}
pub fn sendRawSlice(ctx: *Context, slice: []const u8) Error!void {
ctx.response.send(slice) catch unreachable;
}
 
pub fn sendError(ctx: *Context, comptime code: std.http.Status) Error!void {
return Routes.defaultResponse(code)(ctx);