-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat] swagger 세팅
- Loading branch information
Showing
4 changed files
with
100 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
import { NestFactory } from '@nestjs/core'; | ||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; | ||
|
||
import { AppModule } from '@/app.module'; | ||
|
||
async function bootstrap() { | ||
const app = await NestFactory.create(AppModule); | ||
app.setGlobalPrefix('api'); | ||
|
||
//swagger setting | ||
const config = new DocumentBuilder() | ||
.setTitle('Ticle API server') | ||
.setDescription('API 서버의 api 문서입니다.') | ||
.setVersion('1.0') | ||
.build(); | ||
const document = SwaggerModule.createDocument(app, config); | ||
SwaggerModule.setup('api-doc', app, document); | ||
|
||
app.setGlobalPrefix('api'); | ||
await app.listen(process.env.PORT ?? 3000); | ||
} | ||
bootstrap(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.