primera instancia de validador y carga del excel de usuarios, falta agregar las relaciones con las carreras y verificar los validadores
This commit is contained in:
+48
-1
@@ -1,8 +1,55 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { GlobalExceptionFilter } from './helpers/exception.filter';
|
||||
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
app.enableCors();
|
||||
|
||||
app.useGlobalPipes(
|
||||
new ValidationPipe({
|
||||
transform: true,
|
||||
}),
|
||||
);
|
||||
|
||||
app.useGlobalFilters(new GlobalExceptionFilter());
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Documentacion de la api de carga masiva de CEDETEC')
|
||||
.setDescription(
|
||||
'El objetivo es mejorar la gestion interna y la integridad de los datos',
|
||||
)
|
||||
.setVersion('1.0')
|
||||
.addBearerAuth()
|
||||
.build();
|
||||
// .addServer(process.env.SWAGGER_SERVER_URL) // descomentar parael servidor de acatlan
|
||||
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
|
||||
SwaggerModule.setup('documentation', app, document);
|
||||
|
||||
const port = process.env.API_PORT || 4000;
|
||||
await app.listen(port, '0.0.0.0');
|
||||
|
||||
console.log(
|
||||
`[main] Aplicación iniciada en el puerto ${port} a las ${new Date().toISOString()}`,
|
||||
);
|
||||
console.log(
|
||||
`\n\x1b[36m=========================================================\x1b[0m`,
|
||||
);
|
||||
console.log(`\x1b[36m SISTEMA DE CARGA MASIVA - API\x1b[0m`);
|
||||
console.log(
|
||||
`\x1b[36m=========================================================\x1b[0m`,
|
||||
);
|
||||
console.log(`\x1b[32m✅ API corriendo en:\x1b[0m http://localhost:${port}`);
|
||||
console.log(
|
||||
`\x1b[32m✅ Documentación disponible en:\x1b[0m http://localhost:${port}/documentation`,
|
||||
);
|
||||
|
||||
console.log(
|
||||
`\x1b[36m=========================================================\x1b[0m\n`,
|
||||
);
|
||||
}
|
||||
bootstrap();
|
||||
|
||||
Reference in New Issue
Block a user