You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kempt-kinkajou-2023/weather_platform/apps/sensors-service/src/main.ts

35 lines
993 B

/**
* This is not a production server yet!
* This is only a minimal backend to get started.
*/
import { Logger } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import {DocumentBuilder, SwaggerModule} from "@nestjs/swagger";
import { AppModule } from './app/app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const globalPrefix = 'api';
app.setGlobalPrefix(globalPrefix);
const config = new DocumentBuilder()
.setTitle('CyberGarden Weather Sensors Service')
.setDescription('This api need for store sensors data')
.setVersion('1.0')
.addTag('Sensors Service')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, document);
const port = process.env.SENSORS_SERVICE_PORT || 3000;
app.enableCors();
await app.listen(port);
Logger.log(
`🚀 Sensors Service is running on: http://localhost:${port}/${globalPrefix}`
);
}
bootstrap();