feat(api): app NestJS con configuración validada y health check

Nest 12 (ESM, vitest, oxlint). El .env se valida con zod al arrancar;
prefijo global /api, CORS configurable y GET /api/health.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GeorgeandClaude Sonnet 5.5 committed 2026-10-13 18:13:52 -05:00
1 parent e4417705e7
commit 445efc998d
21 files changed
+6145 -1

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { NestFactory } from '@nestjs/core';
import type { LogLevel } from '@nestjs/common';
import { AppModule } from './app.module.js';
import { AppConfigService } from './config/app-config.service.js';
const LOG_LEVELS: LogLevel[] = ['error', 'warn', 'log', 'debug', 'verbose'];
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const config = app.get(AppConfigService);
app.setGlobalPrefix('api');
app.useLogger(LOG_LEVELS.slice(0, LOG_LEVELS.indexOf(config.get('LOG_LEVEL')) + 1));
app.enableCors({ origin: config.get('CORS_ORIGINS') });
app.enableShutdownHooks();
await app.listen(config.get('PORT'));
}
await bootstrap();