-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: swagger dependency 추가 * feat: swagger 설정 * chore: workflows swagger env 추가
- Loading branch information
Showing
5 changed files
with
76 additions
and
13 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
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,8 +1,29 @@ | ||
import { NestFactory } from '@nestjs/core'; | ||
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; | ||
import { AppModule } from './app.module'; | ||
import * as expressBasicAuth from 'express-basic-auth'; | ||
|
||
async function bootstrap() { | ||
const app = await NestFactory.create(AppModule); | ||
|
||
app.use( | ||
['/api/docs'], | ||
expressBasicAuth({ | ||
challenge: true, | ||
users: { | ||
[process.env.SWAGGER_USER]: process.env.SWAGGER_PASSWORD, | ||
}, | ||
}), | ||
); | ||
|
||
const config = new DocumentBuilder() | ||
.setTitle('EMR API') | ||
.setDescription('FREEMED EMR (Electronic Medical Record) API') | ||
.setVersion('2.0') | ||
.build(); | ||
const document = SwaggerModule.createDocument(app, config); | ||
SwaggerModule.setup('api/docs', app, document); | ||
|
||
await app.listen(parseInt(process.env.PORT, 10) || 3000); | ||
} | ||
bootstrap(); |
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