Don't return 404, just return the index (some routes look like asset files since tlds look like file extensions)
This commit is contained in:
parent
4d57e4e6ed
commit
cdc9f927b5
1 changed files with 0 additions and 6 deletions
|
|
@ -262,12 +262,6 @@ app.use(
|
||||||
// SPA fallback for routes that don't match static files
|
// SPA fallback for routes that don't match static files
|
||||||
app.get("*", async context => {
|
app.get("*", async context => {
|
||||||
const requestUrl = requestUrlFromContext(context)
|
const requestUrl = requestUrlFromContext(context)
|
||||||
|
|
||||||
// If the path has an extension, it's likely a missing static asset, not an SPA route
|
|
||||||
if (path.extname(requestUrl.pathname)) {
|
|
||||||
return context.text("Not found", 404)
|
|
||||||
}
|
|
||||||
|
|
||||||
const metadata = await getMetadataForRoute(requestUrl)
|
const metadata = await getMetadataForRoute(requestUrl)
|
||||||
const html = metadata ? injectMeta(metadata) : TEMPLATE_HTML
|
const html = metadata ? injectMeta(metadata) : TEMPLATE_HTML
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue