PR feedback.

This commit is contained in:
Bob Farrell 2024-02-17 15:31:40 +00:00
parent 31927cdb6b
commit 8ac2afbec2
3 changed files with 8 additions and 1 deletions

View File

@ -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 {
};

View File

@ -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,

View File

@ -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| {