about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAlan Pearce2023-09-12 17:17:50 +0200
committerAlan Pearce2023-09-12 17:17:50 +0200
commit2ea9c80f1599398e122e3531c6e9be6b091e60af (patch)
tree22870c75dd504c5e506a87263294023837a7b6e8 /src
parentaa663a1c5308c2035e1aa73836b932eba040abfc (diff)
downloadwebsite-2ea9c80f1599398e122e3531c6e9be6b091e60af.tar.lz
website-2ea9c80f1599398e122e3531c6e9be6b091e60af.tar.zst
website-2ea9c80f1599398e122e3531c6e9be6b091e60af.zip
wtf typescript
Diffstat (limited to 'src')
-rw-r--r--src/index.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/index.ts b/src/index.ts
index 10e9da1..1b181a1 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -65,14 +65,14 @@ walkDirectory(publicDir, "");
 export default withHtmlLiveReload({
   fetch: async function (request) {
     const pathname = new URL(request.url).pathname;
-    if (files.has(pathname)) {
-      const file = files.get(pathname);
-      console.info("filename", file.filename);
+    const file = files.get(pathname);
+    if (file) {
       return new Response(Bun.file(file.filename), {
         headers: defaultHeaders,
         status: 200,
       });
     }
+
     return new Response(Bun.file(getFilename("404.html")), {
       headers: Object.assign({}, defaultHeaders, {
         "cache-control": "max-age=5, no-cache",