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

38 lines
995 B
TypeScript
Executable file

// Keep process alive
const keepAlive = setInterval(() => {
console.log('Keep-alive tick at', new Date().toISOString());
}, 5000);
import { NestFactory } from '@nestjs/core';
import { AppModule } from './src/app.module';
process.on('uncaughtException', (err) => {
console.error('UNCAUGHT EXCEPTION:', err);
});
process.on('unhandledRejection', (reason, promise) => {
console.error('UNHANDLED REJECTION:', reason);
});
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');
clearInterval(keepAlive); // Stop keepalive once app is running
} catch (err) {
console.error('ERROR IN BOOTSTRAP:', err);
}
}
testBootstrap();