mirror of
https://github.com/withastro/astro.git
synced 2025-04-14 23:51:49 -05:00
fix(node): delegate preview's not found and error handling to core/app (#8141)
* fix(node): delegate preview's not found and error handling to core/app * add changeset --------- Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
af9bcab986
commit
bed930a358
1 changed files with 1 additions and 9 deletions
|
@ -38,15 +38,7 @@ const preview: CreatePreviewServer = async function ({
|
|||
}
|
||||
|
||||
const handler: http.RequestListener = (req, res) => {
|
||||
ssrHandler(req, res, (ssrErr: any) => {
|
||||
if (ssrErr) {
|
||||
res.writeHead(500);
|
||||
res.end(ssrErr.toString());
|
||||
} else {
|
||||
res.writeHead(404);
|
||||
res.end();
|
||||
}
|
||||
});
|
||||
ssrHandler(req, res);
|
||||
};
|
||||
|
||||
const baseWithoutTrailingSlash: string = base.endsWith('/')
|
||||
|
|
Loading…
Add table
Reference in a new issue