Cộng đồng Hỏi & Đáp của Inflearn
swagger 404
Viết
·
624
·
Đã chỉnh sửa
1
문서와 동일하고 동영상과 동일하게 작성했습니다.
npm install --save @nestjs/swagger
그런데 404가 뜨네요... 원인을 잘 모르겠습니다.
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as process from 'process';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
declare const module: any;
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const port = process.env.PORT;
await app.listen(port);
console.log(`listening on port ${port}`);
const config = new DocumentBuilder()
.setTitle('Sleact Api')
.setDescription('Sleact 개발을 위한 API 문서')
.setVersion('1.0')
.addTag('sleact')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, document);
if (module.hot) {
module.hot.accept();
module.hot.dispose(() => app.close());
}
}
bootstrap();

Quiz
NestJS에서 컨트롤러를 생성할 때 일반적으로 먼저 생성하는 것이 권장되는 주요 구성 요소는 무엇일까요?
Service
Pipe
Module
Guard






네네 app.listen보다 위에있어야합니다