1
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
// Enable CORS for frontend
|
||||
// تفعيل تبادل الموارد مع الواجهة الأمامية
|
||||
app.enableCors();
|
||||
|
||||
// Swagger Documentation Setup
|
||||
// إعداد توثيق API (Swagger)
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Jordan Map Platform API')
|
||||
.setDescription('Backend API for map services, routing, and driver telemetry for Jordan')
|
||||
.setVersion('1.0')
|
||||
.addTag('maps')
|
||||
.addTag('telemetry')
|
||||
.build();
|
||||
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
SwaggerModule.setup('api', app, document);
|
||||
|
||||
const port = process.env.API_PORT || 3000;
|
||||
await app.listen(port);
|
||||
console.log(`🚀 Jordan Map API is running on: http://localhost:${port}/api`);
|
||||
}
|
||||
bootstrap();
|
||||
Reference in New Issue
Block a user