mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(api): ♻️ Serve frontend from static files instead of proxying another process
This commit is contained in:
parent
5f8c57b3e1
commit
58b4d7454f
8 changed files with 133 additions and 107 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue