diff --git a/src/app/views/zmpl.manifest.zig b/src/app/views/zmpl.manifest.zig new file mode 100644 index 0000000..3d67249 --- /dev/null +++ b/src/app/views/zmpl.manifest.zig @@ -0,0 +1,5 @@ +// Zmpl template manifest. +// This file is automatically generated at build time. Manual edits will be discarded. +// This file should _not_ be stored in version control. +pub const templates = struct { +}; diff --git a/src/compile_static_routes.zig b/src/compile_static_routes.zig index dd02001..207dc19 100644 --- a/src/compile_static_routes.zig +++ b/src/compile_static_routes.zig @@ -39,7 +39,8 @@ fn compileStaticRoutes(allocator: std.mem.Allocator) !void { const view = try route.renderStatic(route, &request); defer view.deinit(); - const dir = try std.fs.cwd().makeOpenPath("static", .{}); + var dir = try std.fs.cwd().makeOpenPath("static", .{}); + defer dir.close(); const json_path = try std.mem.concat( allocator, diff --git a/src/jetzig/http/Server.zig b/src/jetzig/http/Server.zig index eb8e74e..5a2ae5c 100644 --- a/src/jetzig/http/Server.zig +++ b/src/jetzig/http/Server.zig @@ -408,6 +408,7 @@ fn matchStaticContent(self: *Self, request: *jetzig.http.Request) !?[]const u8 { else => return err, } }; + defer static_dir.close(); // TODO: Use a hashmap to avoid O(n) for (self.routes) |route| {