refactor(server): config system (#11081)

This commit is contained in:
forehalo
2025-03-27 12:32:28 +00:00
parent 7091111f85
commit 0ea38680fa
274 changed files with 7583 additions and 5841 deletions
+7 -5
View File
@@ -4,15 +4,17 @@ import './prelude';
import { Logger } from '@nestjs/common';
import { createApp } from './app';
import { URLHelper } from './base';
import { Config, URLHelper } from './base';
const app = await createApp();
const listeningHost = '0.0.0.0';
await app.listen(AFFiNE.server.port, listeningHost);
const config = app.get(Config);
const url = app.get(URLHelper);
const listeningHost = '0.0.0.0';
await app.listen(config.server.port, listeningHost);
const logger = new Logger('App');
logger.log(`AFFiNE Server is running in [${AFFiNE.type}] mode`);
logger.log(`Listening on http://${listeningHost}:${AFFiNE.server.port}`);
logger.log(`AFFiNE Server is running in [${env.DEPLOYMENT_TYPE}] mode`);
logger.log(`Listening on http://${listeningHost}:${config.server.port}`);
logger.log(`And the public server should be recognized as ${url.home}`);