Files
cedetec_api_nest/src/main.ts
T

31 lines
951 B
TypeScript
Raw Normal View History

2023-02-09 16:10:08 -06:00
import { NestFactory } from '@nestjs/core';
2023-03-24 15:00:03 -06:00
import { NestExpressApplication } from '@nestjs/platform-express';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
2023-03-24 15:00:03 -06:00
import { join } from 'path';
2023-02-09 16:10:08 -06:00
import { AppModule } from './app.module';
async function bootstrap() {
2023-03-24 15:00:03 -06:00
const app = await NestFactory.create<NestExpressApplication>(AppModule);
const config = new DocumentBuilder()
.addBearerAuth()
.setTitle('Documentacion')
.setDescription('des')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, document);
2023-03-24 15:00:03 -06:00
app.useStaticAssets(join(__dirname, '..', 'public'), {
prefix: '/public/',
});
app.enableCors();
await app.listen(AppModule.port);
const port = AppModule.port;
console.log(`Documentacion disponible en: http://localhost:${port}/api`);
console.log(`Servidor desplegado en: http://localhost:${port}`);
2023-02-09 16:10:08 -06:00
}
2026-08-08 23:00:46 -06:00
bootstrap();