Fix broken server failsafe when Vite dev server isn't started

This commit is contained in:
Jesse Wierzbinski 2024-03-11 16:55:12 -10:00
parent a05c25da8f
commit 8016a04e8f
No known key found for this signature in database

View file

@ -168,7 +168,22 @@ export const createServer = (
config.http.base_url, config.http.base_url,
"http://localhost:5173" "http://localhost:5173"
) )
); ).catch(async e => {
await logger.logError(
LogLevel.ERROR,
"Server.Proxy",
e as Error
);
await logger.log(
LogLevel.ERROR,
"Server.Proxy",
`The development Vite server is not running or the route is not found: ${req.url.replace(
config.http.base_url,
"http://localhost:5173"
)}`
);
return errorResponse("Route not found", 404);
});
if ( if (
proxy.status !== 404 && proxy.status !== 404 &&