NestJS10 [NestJS] custom-providers https://docs.nestjs.com/fundamentals/custom-providers Documentation | NestJS - A progressive Node.js framework Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Rea docs.nestjs.com 😀 custom-provi.. 2023. 9. 11. [NestJS] custom-decorators 😀 custom-decortators ES2016 데코레이터는 함수를 반환하고 대상, 이름 속성 설명자를 인수로 사용할 수 있는 표현식 입니다. @ 장식자 앞에 문자를 붙이고 장식하려는 항목의 맨 위에 배치하여 적용합니다. 데코레이터는 클래스, 메서드 또는 속성에 대해 정의할 수 있습니다. NodeJS Express 기능과 같은 기능을하는 NestJS의 데코레이터 @Reuqest, @Req() / req @Response(), @Res() / res @Next() / next @Sessio() / req.session @Param(param?: string) / req.params, req.params[param] @Body(param?: string) / req.body, req.body[param] .. 2023. 9. 9. [NestJS] Interceptors Spring AOP AOP Aspect Oriented 핵심 로직과 부가 기능을 분리하여 애플리케이션 전체에 걸쳐 사용되는 부가 기능을 모듈화하여 재사용할 수 있도록 지원하는 것 (관점 지향 프로그래밍) Around -> Before -> After -> After Returing -> After Throwing 1. 선언적 트랜잭션 관리 https://docs.spring.io/spring-framework/reference/data-access/transaction/declarative.html Declarative Transaction Management :: Spring Framework The Spring Framework’s declarative transaction management is .. 2023. 9. 9. [NestJS] Guards 😗 Guard Guard 가 하는 기능은 단 한가지 입니다. 사용자의 요청에 따른 권한처리, 요청에 대한 승인처리를 진행합니다. http://localhost:3000/guard 로 호출했을때, Guard 설정 시, Controller가 호출 되기 전에 요청한 사용자의 권한등을 확인후, 승인된 사용자가 아닐경우 호출을 방지합니다. 호출 순서 : Middleware -> Guard -> pipe Guard는 Middleware 다음에 호출 되며, Pipe는 Guard가 호출된 이후에 호출 됩니다. 테스트 방법 아래의 API 를 생성후, token을 생성해서 호출한다 http://localhost:3000/guard headers Authorization Bearer {token} token 생성 https.. 2023. 9. 8. 이전 1 2 3 다음