Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] swagger 세팅 #102

Merged
merged 4 commits into from
Nov 5, 2024
Merged

[Feat] swagger 세팅 #102

merged 4 commits into from
Nov 5, 2024

Conversation

begong313
Copy link
Collaborator

관련 이슈 번호

close #77

작업 내용

  • swagger 설치
pnpm add @nestjs/swagger swagger-ui-express
  • swagger 세팅
  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); //"URL/api-doc" 으로 swagger 접속가능
  • swagger 테스트
@Get()
  @ApiOperation({ summary: 'swaggerTest' })
  @ApiResponse({ status: 200, description: '기본 존재하는 api Test.' })
  getHello(): string {
    return this.appService.getHello();
  }

PR 포인트

  • 설치 서버쪽에만 잘 됐는지 확인해주시면 될거같습니다....

고민과 학습내용

  • 설치를 제대로 한건가...?
    • pnpm을 첫 사용하고 tuborepo monorepo 를 처음 사용했기 때문에 설치를 제대로 한것인지 잘 모르겠음
    • api 서버로 들어가 위의 설치명령어를 통해 swagger 설치하였음.

스크린샷

스크린샷 2024-11-05 오후 4 07 53

Todo

  • 추후 배포 시 swagger 접속안되게 환경변수 세팅하면서 환경변수에 따라 swagger 접속 안되게 고치기

리뷰 필요 X
{url}/api-doc 으로 접속하면 확인가능
@begong313 begong313 added BE Backend 관련 작업 🔨 Config 환경 설정 작업 labels Nov 5, 2024
@begong313 begong313 added this to the 통합 개발 환경 구축 milestone Nov 5, 2024
@begong313 begong313 self-assigned this Nov 5, 2024
@begong313 begong313 linked an issue Nov 5, 2024 that may be closed by this pull request
@github-actions github-actions bot added the size/m label Nov 5, 2024
apps/api/src/app.controller.ts Show resolved Hide resolved
apps/api/package.json Outdated Show resolved Hide resolved
apps/api/src/main.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@simeunseo simeunseo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

배워갑니다. 🐒

@begong313 begong313 requested a review from seoko97 November 5, 2024 07:41
Copy link
Collaborator

@seoko97 seoko97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍👍

@begong313 begong313 merged commit 8a5f033 into develop Nov 5, 2024
1 check passed
@begong313 begong313 deleted the feat/#77/init-swagger branch December 5, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE Backend 관련 작업 🔨 Config 환경 설정 작업 size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] swagger 초기 설정
3 participants