mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 08:17:10 +08:00
22 lines
587 B
TypeScript
22 lines
587 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
|
|
import { AppModule } from './app.module';
|
|
import { logger } from './logger';
|
|
|
|
export async function bootstrap() {
|
|
// Process setup for parentPort message handling is done inside HelperBootstrapService
|
|
// which is automatically instantiated when the module initializes
|
|
const app = await NestFactory.createApplicationContext(AppModule, {
|
|
logger,
|
|
});
|
|
|
|
// Handle shutdown
|
|
process.on('exit', () => {
|
|
app.close().catch(err => {
|
|
logger.error('Failed to close Nest application context', err);
|
|
});
|
|
});
|
|
|
|
return app;
|
|
}
|