22 lines
688 B
TypeScript
22 lines
688 B
TypeScript
import 'reflect-metadata';
|
|
import 'dotenv/config';
|
|
import { NestFactory } from '@nestjs/core';
|
|
import { AppModule } from './app.module';
|
|
import { ENVIRONMENT } from './config/environment.module';
|
|
import type { Environment } from './config/environment';
|
|
import { configureApp } from './configure-app';
|
|
|
|
async function bootstrap(): Promise<void> {
|
|
const app = await NestFactory.create(AppModule);
|
|
const environment = app.get<Environment>(ENVIRONMENT);
|
|
configureApp(app, environment);
|
|
await app.listen(environment.PORT);
|
|
}
|
|
|
|
void bootstrap().catch(() => {
|
|
console.error(
|
|
'Backend startup failed. Check configuration and database availability.',
|
|
);
|
|
process.exitCode = 1;
|
|
});
|