diff options
Diffstat (limited to 'index.ts')
| -rw-r--r-- | index.ts | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -84,13 +84,15 @@ for await (const req of serve({ port: parseInt(SERVER_PORT), hostname: SERVER_HO if (req.url === "/version.txt") { req.respond({ body: await Deno.readTextFile("version.txt") }); } else if (req.url === "/") { - req.respond({ body: JSON.stringify(await getRepositories()) }); + const headers = new Headers(); + headers.append("Cache-Control", "public,no-transform,max-age=3600"); + headers.append("Expires", new Date().toUTCString()); + req.respond({ body: JSON.stringify(await getRepositories()), headers: headers }); } else { req.respond({ status: 404 }); } - } catch(err) { req.respond({ body: JSON.stringify(err) }); } |
