0
Fork 0
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:
Arsh 2023-08-19 02:21:46 +05:30 committed by GitHub
parent af9bcab986
commit bed930a358

View file

@ -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('/')