mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Fix broken server failsafe when Vite dev server isn't started
This commit is contained in:
parent
a05c25da8f
commit
8016a04e8f
17
server.ts
17
server.ts
|
|
@ -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 &&
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue