Created
August 24, 2020 12:09
-
-
Save nmchenry01/b2e47c6f1d40632653373f9e28f3556a to your computer and use it in GitHub Desktop.
Bootstrap with swagger "NestJS with Swagger"
This file contains hidden or 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
| async function bootstrap() { | |
| const app = await NestFactory.create(AppModule); | |
| const APP_NAME = process.env.npm_package_name; | |
| const APP_VERSION = process.env.npm_package_version; | |
| const options = new DocumentBuilder() | |
| .setTitle(APP_NAME) | |
| .setDescription(`The ${APP_NAME} API description`) | |
| .setVersion(APP_VERSION) | |
| .build(); | |
| const document = SwaggerModule.createDocument(app, options); | |
| SwaggerModule.setup('swagger', app, document); | |
| await app.listen(3000); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment