Initial LisgloSIPS V2 implementation
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import 'reflect-metadata';
|
||||
import helmet from '@fastify/helmet';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { FastifyAdapter, type NestFastifyApplication } from '@nestjs/platform-fastify';
|
||||
import { Logger } from 'nestjs-pino';
|
||||
import { AppModule } from './modules/app.module.js';
|
||||
import { buildOpenApiDocument } from './openapi.js';
|
||||
|
||||
async function bootstrap(): Promise<void> {
|
||||
const app = await NestFactory.create<NestFastifyApplication>(
|
||||
AppModule,
|
||||
new FastifyAdapter({
|
||||
trustProxy: true,
|
||||
logger: false
|
||||
}),
|
||||
{
|
||||
bufferLogs: true
|
||||
}
|
||||
);
|
||||
|
||||
app.useLogger(app.get(Logger));
|
||||
app.setGlobalPrefix('api/v2');
|
||||
await app.register(helmet, {
|
||||
contentSecurityPolicy: false
|
||||
});
|
||||
|
||||
buildOpenApiDocument(app);
|
||||
|
||||
const host = process.env.LISGLOSIPS_HOST ?? '127.0.0.1';
|
||||
const port = Number(process.env.LISGLOSIPS_PORT ?? 3000);
|
||||
|
||||
await app.listen({ host, port });
|
||||
}
|
||||
|
||||
void bootstrap();
|
||||
Reference in New Issue
Block a user