api/src/main.ts   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 28
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 23
mnd 0
bc 0
fnc 1
dl 0
loc 28
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A main.ts ➔ bootstrap 0 19 1
1
import { NestFactory } from '@nestjs/core';
2
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
3
import { ValidationPipe } from '@nestjs/common';
4
import * as helmet from 'helmet';
5
import { AppModule } from './app.module';
6
7
async function bootstrap() {
8
  const app = await NestFactory.create(AppModule);
9
  app.use(helmet());
10
  app.enableCors();
11
  app.setGlobalPrefix('api');
12
  app.useGlobalPipes(new ValidationPipe({ transform: true }));
13
14
  const options = new DocumentBuilder()
15
    .setTitle('PictySchool')
16
    .setDescription('Open source and eco design school photo management software')
17
    .setVersion('1.0.0')
18
    .addBearerAuth()
19
    .build();
20
21
  const document = SwaggerModule.createDocument(app, options);
22
  SwaggerModule.setup('api', app, document);
23
24
  await app.listen(3000, '0.0.0.0');
25
}
26
27
bootstrap();
28