-
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.
[NDD-254]: 개발용 토큰 반환 API 구현 (0.5h / 0.5h) (#106)
* feat: 개발자용 토큰 발급 API controller, service 계층 메서드 구조 구현 * feat: 개발자용 토큰 반환 API 서비스 로직 구현 * feat: 개발자용 토큰 발급 API Authorization 해더로 반환되도록 구현 * docs: default API(/, 더미데이터 만드는 API)와 개발자용 토큰 반환하는 API Swagger 문서에서 제외 * docs: CD 스크립트 수정 * docs: docker run 옵션 추가
- Loading branch information
1 parent
a11e1a9
commit 97fb03e
Showing
7 changed files
with
34 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Controller, Get, Res } from '@nestjs/common'; | ||
import { TokenService } from './service/token.service'; | ||
import { Response } from 'express'; | ||
import { BEARER_PREFIX } from 'src/constant/constant'; | ||
import { ApiExcludeEndpoint } from '@nestjs/swagger'; | ||
|
||
@Controller('/api/token') | ||
export class TokenController { | ||
constructor(private tokenService: TokenService) {} | ||
|
||
@Get() | ||
@ApiExcludeEndpoint() | ||
async getDevToken(@Res() res: Response) { | ||
const devToken = await this.tokenService.getDevToken(); | ||
res.setHeader('Authorization', `${BEARER_PREFIX} ${devToken}`).send(); | ||
} | ||
} |
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