From 2a6c843a514c5f7952c87177824853e016f7b3bc Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Wed, 10 Feb 2021 19:18:01 +0530 Subject: [PATCH] fix 404 on direct /something hits --- workers-site/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workers-site/index.js b/workers-site/index.js index f980a77..db84c55 100644 --- a/workers-site/index.js +++ b/workers-site/index.js @@ -47,7 +47,7 @@ async function handleEvent(event) { if (!DEBUG) { try { let notFoundResponse = await getAssetFromKV(event, { - mapRequestToAsset: req => new Request(`${new URL(req.url).origin}/404.html`, req), + mapRequestToAsset: req => new Request(`${new URL(req.url).origin}/index.html`, req), }) return new Response(notFoundResponse.body, { ...notFoundResponse, status: 404 }) @@ -77,4 +77,4 @@ function handlePrefix(prefix) { // inherit all other props from the default request return new Request(url.toString(), defaultAssetKey) } -} \ No newline at end of file +}