mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 05:09:39 +02:00
Applied formatting to 1487+ files using pnpm format:write - TypeScript/JavaScript files - Svelte components - Astro pages - JSON configs - Markdown docs 13 files still need manual review (Astro JSX comments)
36 lines
876 B
TypeScript
36 lines
876 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { ValidationPipe } from '@nestjs/common';
|
|
import { AppModule } from './app.module';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
|
|
// Enable CORS for web app
|
|
app.enableCors({
|
|
origin: [
|
|
'http://localhost:5180', // voxel-lava web
|
|
'http://localhost:5173',
|
|
'http://localhost:3000',
|
|
'http://localhost:3001', // Mana Core Auth
|
|
],
|
|
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
|
|
credentials: true,
|
|
});
|
|
|
|
// Enable validation
|
|
app.useGlobalPipes(
|
|
new ValidationPipe({
|
|
whitelist: true,
|
|
transform: true,
|
|
forbidNonWhitelisted: true,
|
|
})
|
|
);
|
|
|
|
// Set global prefix for API routes
|
|
app.setGlobalPrefix('api');
|
|
|
|
const port = process.env.PORT || 3010;
|
|
await app.listen(port);
|
|
console.log(`Voxel-Lava backend running on http://localhost:${port}`);
|
|
}
|
|
bootstrap();
|