diff options
author | 2021-04-26 16:42:11 -0400 | |
---|---|---|
committer | 2021-04-26 16:42:11 -0400 | |
commit | 0ea4a986e207238bf0ac1db841b2a5d5b567d84d (patch) | |
tree | 17246b70fd1ab907887bea778790c2f150485c2a /src/runtime.ts | |
parent | 87af0aead8db809ffea402cfc3619de8190c6c16 (diff) | |
download | astro-0ea4a986e207238bf0ac1db841b2a5d5b567d84d.tar.gz astro-0ea4a986e207238bf0ac1db841b2a5d5b567d84d.tar.zst astro-0ea4a986e207238bf0ac1db841b2a5d5b567d84d.zip |
Support 500 pages in the dev server (#131)
* Support 500 pages
* Document custom 400/500 pages
* Remove search from any pages not the 500 page
* fix(kitchen-sink): add snowpack.config.js
* fix(examples): add snowpack.config.js
* style: redesign built-in 500 page
Co-authored-by: Nate Moore <nate@skypack.dev>
Diffstat (limited to 'src/runtime.ts')
-rw-r--r-- | src/runtime.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime.ts b/src/runtime.ts index 330ca013b..a394d93c4 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -195,11 +195,20 @@ async function load(config: RuntimeConfig, rawPathname: string | undefined): Pro collection.data = data; } + const requestURL = new URL(fullurl.toString()); + + // For first release query params are not passed to components. + // An exception is made for dev server specific routes. + if(reqPath !== '/500') { + requestURL.search = ''; + } + let html = (await mod.exports.__renderPage({ request: { host: fullurl.hostname, path: fullurl.pathname, href: fullurl.toString(), + url: requestURL }, children: [], props: { collection }, |