diff --git a/docs-site~/src/index.js b/docs-site~/src/index.js index c9c94e2f..3ec8c62d 100644 --- a/docs-site~/src/index.js +++ b/docs-site~/src/index.js @@ -83,7 +83,17 @@ async function handleEvent(event) { } }); } else { - const page = await getAssetFromKV(event, options); + let page; + try { + page = await getAssetFromKV(event, options); + } catch (e) { + // Try adding .html + options.mapRequestToAsset = function(request) { + return new Request(url.toString() + ".html", defaultAssetKey); + }; + + page = await getAssetFromKV(event, options); + } // allow headers to be altered response = new Response(page.body, page);