mirror of
https://github.com/zigzap/zap.git
synced 2025-10-20 15:14:08 +00:00
cleanup
This commit is contained in:
parent
cd18bffc62
commit
80185931c5
5 changed files with 14 additions and 13 deletions
|
@ -23,7 +23,7 @@ pub fn build(b: *std.build.Builder) !void {
|
|||
.{ .name = "routes", .src = "examples/routes/routes.zig" },
|
||||
.{ .name = "serve", .src = "examples/serve/serve.zig" },
|
||||
.{ .name = "hello_json", .src = "examples/hello_json/hello_json.zig" },
|
||||
.{ .name = "endpoint", .src = "examples/endpoint/main.zig" },
|
||||
.{ .name = "endpoints", .src = "examples/endpoints/main.zig" },
|
||||
}) |excfg| {
|
||||
const ex_name = excfg.name;
|
||||
const ex_src = excfg.src;
|
||||
|
|
|
@ -11,6 +11,7 @@ pub fn main() !void {
|
|||
.port = 3000,
|
||||
.on_request = null,
|
||||
.log = true,
|
||||
.public_folder = "./examples/endpoints/html",
|
||||
},
|
||||
);
|
||||
|
24
src/zap.zig
24
src/zap.zig
|
@ -98,18 +98,18 @@ pub const SimpleRequest = struct {
|
|||
// C.fiobj_free(new_fiobj_str);
|
||||
}
|
||||
|
||||
pub fn nextParam(self: *const Self) ?HttpParam {
|
||||
if (self.h.*.params == 0) return null;
|
||||
var key: C.FIOBJ = undefined;
|
||||
const value = C.fiobj_hash_pop(self.h.*.params, &key);
|
||||
if (value == C.FIOBJ_INVALID) {
|
||||
return null;
|
||||
}
|
||||
return HttpParam{
|
||||
.key = fio2str(key).?,
|
||||
.value = fio2str(value).?,
|
||||
};
|
||||
}
|
||||
// pub fn nextParam(self: *const Self) ?HttpParam {
|
||||
// if (self.h.*.params == 0) return null;
|
||||
// var key: C.FIOBJ = undefined;
|
||||
// const value = C.fiobj_hash_pop(self.h.*.params, &key);
|
||||
// if (value == C.FIOBJ_INVALID) {
|
||||
// return null;
|
||||
// }
|
||||
// return HttpParam{
|
||||
// .key = fio2str(key).?,
|
||||
// .value = fio2str(value).?,
|
||||
// };
|
||||
// }
|
||||
};
|
||||
|
||||
pub const HttpRequestFn = *const fn (r: [*c]C.http_s) callconv(.C) void;
|
||||
|
|
Loading…
Add table
Reference in a new issue