platform-codebase/features/landing/backend-api/test-boot.ts

35 lines
852 B
TypeScript
Executable file

import { NestFactory } from '@nestjs/core';
import { AppModule } from './src/app.module';
process.on('uncaughtException', (err) => {
console.error('UNCAUGHT EXCEPTION:', err);
process.exit(1);
});
process.on('unhandledRejection', (reason, promise) => {
console.error('UNHANDLED REJECTION:', reason);
process.exit(1);
});
async function testBootstrap() {
console.log('1. Starting NestFactory.create...');
try {
const app = await NestFactory.create(AppModule, {
logger: ['error', 'warn', 'log'],
});
console.log('2. NestFactory.create completed, app created');
console.log('3. Starting app.listen...');
await app.listen(3010);
console.log('4. App is now listening on port 3010');
} catch (err) {
console.error('ERROR IN BOOTSTRAP:', err);
process.exit(1);
}
}
testBootstrap();