Commit c336b2e5 authored by nanahira's avatar nanahira

add swagger

parent 600dd7e2
Pipeline #3291 passed with stages
in 1 minute and 35 seconds
#!/bin/bash
npm install --save \
class-validator \
class-transformer \
@nestjs/swagger \
swagger-ui-express \
lodash \
typeorm \
@nestjs/typeorm \
......@@ -11,3 +15,4 @@ npm install --save \
npm install --save-dev \
@types/lodash
@types/express
import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
const documentConfig = new DocumentBuilder()
.setTitle('app')
.setDescription('The app')
.setVersion('1.0')
.addTag('app-tag')
.build();
const document = SwaggerModule.createDocument(app, documentConfig);
SwaggerModule.setup('docs', app, document);
await app.listen(3000);
}
bootstrap();
#!/bin/bash
npm install --save \
class-validator \
class-transformer \
@nestjs/swagger \
swagger-ui-express \
lodash \
typeorm \
@nestjs/typeorm \
......@@ -7,4 +11,5 @@ npm install --save \
reflect-metadata
npm install --save-dev \
@types/lodash
@types/lodash \
@types/express
import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
const documentConfig = new DocumentBuilder()
.setTitle('app')
.setDescription('The app')
.setVersion('1.0')
.addTag('app-tag')
.build();
const document = SwaggerModule.createDocument(app, documentConfig);
SwaggerModule.setup('docs', app, document);
await app.listen(3000);
}
bootstrap();
import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
const documentConfig = new DocumentBuilder()
.setTitle('app')
.setDescription('The app')
.setVersion('1.0')
.addTag('app-tag')
.build();
const document = SwaggerModule.createDocument(app, documentConfig);
SwaggerModule.setup('docs', app, document);
await app.listen(3000);
}
bootstrap();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment