import { NestFactory } from '@nestjs/core' ; import { SwaggerModule , DocumentBuilder } from '@nestjs/swagger' ; import { ValidationPipe } from '@nestjs/common' ; import * as helmet from 'helmet' ; import { AppModule } from './app.module' ; async function bootstrap ( ) { const app = await NestFactory . create ( AppModule ) ; app . use ( helmet ( ) ) ; app . enableCors ( ) ; app . setGlobalPrefix ( 'api' ) ; app . useGlobalPipes ( new ValidationPipe ( { transform : true } ) ) ; const options = new DocumentBuilder ( ) . setTitle ( 'Permacoop' ) . setDescription ( 'PermaCoop is an eco-design and open-source ERP solution for cooperatives.' ) . setVersion ( '1.0.0' ) . addBearerAuth ( ) . build ( ) ; const document = SwaggerModule . createDocument ( app , options ) ; SwaggerModule . setup ( 'api' , app , document ) ; await app . listen ( 3000 , '0.0.0.0' ) ; } bootstrap ( ) ;