| 1 | // First import: the SDK has to patch http, pg and the rest before Nest pulls them in. |
| 2 | import './instrumentation.js'; |
| 3 | |
| 4 | import { NestFactory } |
| 5 | import { AppModule } |
| 6 | import { SwaggerModule } |
| 7 | import { apiReference } |
| 8 | import morgan from 'morgan |
| 9 | import { configureApp } |
| 10 | import { openApiConfig } |
| 11 | |
| 12 | async function bootstrap() |
| 13 | const app = |
| 14 | bodyParser: false, |
| 15 | }); |
| 16 | app.enableShutdownHooks(); |
| 17 | app.use(morgan |
| 18 | configureApp(app); |
| 19 | |
| 20 | const document = |
| 21 | app.use( |
| 22 | '/reference', |
| 23 | apiReference({ content: |
| 24 | ); |
| 25 | |
| 26 | app.enableCors({ |
| 27 | origin: (process.env |
| 28 | .split(',') |
| 29 | .map((origin) |
| 30 | .filter(Boolean), |
| 31 | credentials: true, |
| 32 | }); |
| 33 | const port = |
| 34 | console.log(`Starting application on |
| 35 | await app.listen |
| 36 | } |
| 37 | await bootstrap(); |