mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add catch all page
This commit is contained in:
parent
2bf0572a06
commit
5992a0a51b
1 changed files with 28 additions and 0 deletions
28
src/pages/[...page].astro
Normal file
28
src/pages/[...page].astro
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
---
|
||||||
|
// import { getPathPartsFromAstroRequest } from '~/helpers/url.js'
|
||||||
|
import { catchRedirectResponse } from '~/helpers/astro/request.js'
|
||||||
|
|
||||||
|
import Layout from '../layouts/default.astro'
|
||||||
|
|
||||||
|
// Component Script:
|
||||||
|
// You can write any JavaScript/TypeScript that you'd like here.
|
||||||
|
// It will run during the build, but never in the browser.
|
||||||
|
// All variables are available to use in the HTML template below.
|
||||||
|
|
||||||
|
// Full Astro Component Syntax:
|
||||||
|
// https://docs.astro.build/core-concepts/astro-components/
|
||||||
|
|
||||||
|
const redirectResponse = await catchRedirectResponse( Astro )
|
||||||
|
|
||||||
|
if ( redirectResponse !== null ) {
|
||||||
|
return redirectResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not found
|
||||||
|
return new Response(null, {
|
||||||
|
status: 404,
|
||||||
|
statusText: 'Not found'
|
||||||
|
})
|
||||||
|
|
||||||
|
---
|
||||||
|
404
|
||||||
Loading…
Add table
Add a link
Reference in a new issue