all repos — website @ 2ea9c80f1599398e122e3531c6e9be6b091e60af

My website

wtf typescript
Alan Pearce alan@alanpearce.eu
Tue, 12 Sep 2023 17:17:50 +0200
commit

2ea9c80f1599398e122e3531c6e9be6b091e60af

parent

aa663a1c5308c2035e1aa73836b932eba040abfc

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M src/index.tssrc/index.ts
@@ -65,14 +65,14 @@ 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",