2
0

main.ts 546 B

1234567891011121314151617181920
  1. import { NestFactory } from '@nestjs/core';
  2. import { AppModule } from './app.module';
  3. import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
  4. async function bootstrap() {
  5. const app = await NestFactory.create(AppModule, {
  6. cors: true,
  7. });
  8. const config = new DocumentBuilder()
  9. .setTitle('Milvus admin')
  10. .setVersion('1.0')
  11. .build();
  12. const document = SwaggerModule.createDocument(app, config);
  13. SwaggerModule.setup('api', app, document);
  14. app.setGlobalPrefix('/api/v1');
  15. await app.listen(3000);
  16. }
  17. bootstrap();