mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
refactor(server): config system (#11081)
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user