╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │124 fn handleRequest( │ │125 http_server: *std.http.Server, │ │126 request: *std.http.Server.Request, │ │127 + allocator: std.mem.Allocator, │ │128 ) !void { │ │129 const method = if (request.head.method == .HEAD) .GET else request.head.method;│ │130 if (method != .GET) { │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │158 http_server.reader.state = .ready; │ │159 } │ │160 │ │133 - try writeStaticResponse(http_server, 200, "OK", asset.content_type, asset.body, request.head.method == .HEAD); │ │161 + if (std.mem.eql(u8, asset.path, "index.html")) { │ │162 + const index_html = try renderIndexHtml(allocator); │ │163 + defer allocator.free(index_html); │ │164 + try writeStaticResponse(http_server, 200, "OK", asset.content_type, index_html, request.head.method == .HEAD);│ │165 + } else { │ │166 + try writeStaticResponse(http_server, 200, "OK", asset.content_type, asset.body, request.head.method == .HEAD);│ │167 + } │ │168 } │ │169 │ │170 fn findAsset(request_path: []const u8) ?Asset { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯