14 lines
423 B
TypeScript
14 lines
423 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
||
import { AppModule } from './app.module';
|
||
|
||
async function bootstrap() {
|
||
const app = await NestFactory.create(AppModule);
|
||
|
||
app.setGlobalPrefix('api'); // Все маршруты будут начинаться с `/api`
|
||
app.enableCors(); // Разрешаем CORS
|
||
|
||
await app.listen(3000);
|
||
console.log('🚀 Server running on http://localhost:3000/api');
|
||
}
|
||
bootstrap();
|