mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 16:59:41 +02:00
2. URL configuration fix (BASE_URL, FRONTEND_URL) 3. Password reset URL pointing to frontend instead of API
35 lines
896 B
TypeScript
35 lines
896 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { ValidationPipe } from '@nestjs/common';
|
|
import { createCorsConfig } from '@manacore/shared-nestjs-cors';
|
|
import { AppModule } from './app.module';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
|
|
// Enable CORS with centralized configuration
|
|
app.enableCors(
|
|
createCorsConfig({
|
|
corsOriginsEnv: process.env.CORS_ORIGINS,
|
|
})
|
|
);
|
|
|
|
// Global exception filter will be added later via module
|
|
// app.useGlobalFilters(new AppExceptionFilter());
|
|
|
|
// Enable validation
|
|
app.useGlobalPipes(
|
|
new ValidationPipe({
|
|
whitelist: true,
|
|
transform: true,
|
|
forbidNonWhitelisted: true,
|
|
})
|
|
);
|
|
|
|
// Set global prefix for API routes
|
|
app.setGlobalPrefix('api/v1');
|
|
|
|
const port = process.env.PORT || 3002;
|
|
await app.listen(port);
|
|
console.log(`Chat backend running on http://localhost:${port}`);
|
|
}
|
|
bootstrap();
|