diff --git a/examples/zig-examples/build.zig b/examples/zig-examples/build.zig index 61ac3cd..aa1891d 100644 --- a/examples/zig-examples/build.zig +++ b/examples/zig-examples/build.zig @@ -45,11 +45,11 @@ const examples = &[_]Example{ .root_source_file = .{ .path = "src/params.zig" }, .path = "params/[id]", }, - //.{ - // .name = "router", - // .root_source_file = .{ .path = "src/router.zig" }, - // .path = "router/[...path]", - //}, + .{ + .name = "router", + .root_source_file = .{ .path = "src/router.zig" }, + .path = "router/[...path]", + }, }; const Example = struct { @@ -64,7 +64,7 @@ pub fn build(b: *std.Build) !void { const optimize = b.standardOptimizeOption(.{}); const wws_dep = b.dependency("wws", .{}); - //const zig_router_dep = b.dependency("zig-router", .{}); + const zig_router_dep = b.dependency("zig-router", .{}); const wf = b.addWriteFiles(); @@ -79,7 +79,7 @@ pub fn build(b: *std.Build) !void { .features = e.features orelse .{}, }); - //worker.exe.root_module.addImport("zig-router", zig_router_dep.module("zig-router")); + worker.exe.root_module.addImport("zig-router", zig_router_dep.module("zig-router")); try worker.addToWriteFiles(b, wf); } diff --git a/examples/zig-examples/build.zig.zon b/examples/zig-examples/build.zig.zon index 0ed799c..1945c22 100644 --- a/examples/zig-examples/build.zig.zon +++ b/examples/zig-examples/build.zig.zon @@ -41,10 +41,10 @@ .wws = .{ .path = "../../kits/zig/wws", }, - //.@"zig-router" = .{ - // .url = "https://github.com/Cloudef/zig-router/archive/dc438755c5a6d5fec2efb9e413e8c03a3f637585.tar.gz", - // .hash = "1220a53ebca3e6d9958341c83767ef9763f947ef68e60362764d12a972227a1339bc", - //}, + .@"zig-router" = .{ + .url = "https://github.com/Cloudef/zig-router/archive/e8df16c9281969aef3cbb3c788f2c8c2b4f9ec30.tar.gz", + .hash = "1220fabbdaa72ff4801b62cc577e2e63849e960fbc22b67d560080726c53fb7c28cc", + }, }, // Specifies the set of files and directories that are included in this package. diff --git a/examples/zig-examples/src/router.zig b/examples/zig-examples/src/router.zig index 18d251e..72c252b 100644 --- a/examples/zig-examples/src/router.zig +++ b/examples/zig-examples/src/router.zig @@ -31,8 +31,8 @@ fn handle(arena: std.mem.Allocator, request: wws.Request) !wws.Response { const router = zig_router.Router( .{}, .{ - zig_router.Route(.GET, "/router/hello", getHello), - zig_router.Route(.GET, "/router/post/:id", getBlogPost), + zig_router.Route(.GET, "/router/hello", getHello, .{}), + zig_router.Route(.GET, "/router/post/:id", getBlogPost, .{}), }, );