From a01c6146ec72ef4a10405d752488aa47fc936bb4 Mon Sep 17 00:00:00 2001 From: renerocksai Date: Sun, 30 Mar 2025 20:32:33 +0200 Subject: [PATCH] Minor README & comment cosmetics --- README.md | 2 +- examples/endpoint/error.zig | 6 +++--- src/App.zig | 7 ------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 88c2978..6f0e328 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ really promising. - [jetzig](https://github.com/jetzig-framework/jetzig) : Comfortably develop modern web applications quickly, using http.zig under the hood - [zzz](https://github.com/tardy-org/zzz) : Super promising, super-fast, -especially for IO-heavy tasks, io_uring support - need I say more? + especially for IO-heavy tasks, io_uring support - need I say more? ## 💪 Robust diff --git a/examples/endpoint/error.zig b/examples/endpoint/error.zig index 3e5ee2f..178be67 100644 --- a/examples/endpoint/error.zig +++ b/examples/endpoint/error.zig @@ -1,7 +1,8 @@ const std = @import("std"); const zap = @import("zap"); -/// A simple endpoint listening on the /error route that causes an error on GET requests, which gets logged to the response (=browser) by default +/// A simple endpoint listening on the /error route that causes an error on GET +/// requests, which gets logged to the response (=browser) by default pub const ErrorEndpoint = @This(); path: []const u8 = "/error", @@ -11,9 +12,8 @@ pub fn get(_: *ErrorEndpoint, _: zap.Request) !void { return error.@"Oh-no!"; } +// unused: pub fn post(_: *ErrorEndpoint, _: zap.Request) !void {} -// pub fn post(_: *ErrorEndpoint, _: zap.Request) !void {} - pub fn put(_: *ErrorEndpoint, _: zap.Request) !void {} pub fn delete(_: *ErrorEndpoint, _: zap.Request) !void {} pub fn patch(_: *ErrorEndpoint, _: zap.Request) !void {} diff --git a/src/App.zig b/src/App.zig index d53cba3..e8a381d 100644 --- a/src/App.zig +++ b/src/App.zig @@ -1,10 +1,3 @@ -//! WIP: zap.App. -//! -//! - Per Request Arena(s) thread-local? -//! - Custom "State" Context, type-safe -//! - route handlers -//! - automatic error catching & logging, optional report to HTML - const std = @import("std"); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator;