Skip to content

Commit

Permalink
fix(node): delegate preview's not found and error handling to core/app (
Browse files Browse the repository at this point in the history
#8141)

* fix(node): delegate preview's not found and error handling to core/app

* add changeset

---------

Co-authored-by: Nate Moore <[email protected]>
  • Loading branch information
lilnasy and natemoo-re authored Aug 18, 2023
1 parent af9bcab commit bed930a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/integrations/node/src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('/')
Expand Down

0 comments on commit bed930a

Please sign in to comment.