import { NestFactory } from '@nestjs/core'; import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; import { AppModule } from './app.module'; import { join } from 'path'; import * as express from 'express'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.use('/uploads', express.static(join(__dirname, '..', 'uploads'))); app.setGlobalPrefix(''); const config = new DocumentBuilder() .setTitle('Travelmarine backend') .setDescription('Backend API for Travelmarine service') .setVersion('0.1') .addServer('http://localhost:4000', 'Local server') .addServer('http://89.169.188.2/api', 'Production server') .build(); const documentFactory = () => SwaggerModule.createDocument(app, config); SwaggerModule.setup('/', app, documentFactory); await app.listen(process.env.PORT ?? 4000); } bootstrap();