refactor(api): ♻️ Serve frontend from static files instead of proxying another process

This commit is contained in:
Jesse Wierzbinski 2025-03-27 18:51:22 +01:00
parent 5f8c57b3e1
commit 58b4d7454f
No known key found for this signature in database
8 changed files with 133 additions and 107 deletions

View file

@ -13,7 +13,7 @@ await configureLoggers();
const serverLogger = getLogger("server");
console.info(`
@ -36,20 +36,6 @@ serverLogger.info`Versia Server started at ${config.http.bind}:${config.http.bin
serverLogger.info`Database is online, now serving ${postCount} posts`;
if (config.frontend.enabled) {
// Check if frontend is reachable
const response = await fetch(new URL("/", config.frontend.url))
.then((res) => res.ok)
.catch(() => false);
if (!response) {
serverLogger.error`Frontend is unreachable at ${config.frontend.url}`;
serverLogger.error`Please ensure the frontend is online and reachable`;
}
} else {
serverLogger.warn`Frontend is disabled, skipping check`;
}
// Check if Redis is reachable
const connection = new IORedis({
host: config.redis.queue.host,