mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-13 13:48:26 +00:00
Adjust 404 catch all
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
export default eventHandler(() => {
|
||||
return { nitro: 'Is Awesome! asda' };
|
||||
});
|
||||
@@ -34,6 +34,16 @@ vercelRouteConfig.routes = [
|
||||
...vercelRouteConfig.routes,
|
||||
]
|
||||
|
||||
// Adjust the existing catch-all route to only catch API routes, so that we can add a new catch-all route for 404s
|
||||
const allCatchRoute = '/(.*)';
|
||||
const fallBackIndex = vercelRouteConfig.routes.findIndex(route => route.handle === allCatchRoute);
|
||||
|
||||
vercelRouteConfig.routes[fallBackIndex].src = '/api/(.*)'
|
||||
vercelRouteConfig.routes.push({
|
||||
src: allCatchRoute,
|
||||
dest: '/404.html',
|
||||
})
|
||||
|
||||
const output = JSON.stringify(vercelRouteConfig, null, 2);
|
||||
|
||||
await fs.promises.writeFile(vercelOutputJSON, output, 'utf-8');
|
||||
|
||||
Reference in New Issue
Block a user