aboutsummaryrefslogtreecommitdiffstats
path: root/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'index.ts')
-rw-r--r--index.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/index.ts b/index.ts
index 830692b..d8eba17 100644
--- a/index.ts
+++ b/index.ts
@@ -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) });
}