본문 바로가기

Nest JS 기본 구성 및 활용

(3)
destructure [js] * @Param부분의 id값만 console에 나타나게 해보기 1번과 2번 차이점 확인하기 1번(기존) @Controller("students") export class StudentController { @Get("/:studentId") getStudentById(@Param() params: {studentId : string}) { --- # 1 console.log(params) return "Get Student By Id" } #1번의 params의 이름은 중요하지 않음 params1이라고 입력하고 console.log(params1)이렇게 입력해도 콘솔창에는 { studentId : 1234 } 라고 찍힘 2번(destructuring) @Controller("students") expor..
Functional programming (FP) vs Object oriented programming (OOP) let name = "SAMSUNG STORE' //겹치는 것들을 줄이기 위해 class Product { // 추상화 name = ''; price = 0; constructor(name,price){ this.name=name this.price=price } getPrice(){ return this.price+'만원'; }//캡슐화 setPrice(price){ if(price { alert(this.props.friend + " 를 팔로우 했습니다.") } 친구를 팔로우 하면 3초 후에 this.showMsg() 라는 메소드가 실행되어 "~ 를 팔로우 했습니다." 라는 메시지를 띄워준다고 가정해보자. 1. A 친구 프로필에 들어가서 팔로우 클릭. (3초 후 메시지 출력 예정) 2. 3초가 지나기..
Nest JS 1. Nest js 소개 2. CRUD 앱 구성하며 nest js 기본 구성 배우기 3. PG DB & TypeORM 이용해서 앱 구성 4. 인증 처리 추가(JWT) 5. 권한 처리 추가(PASSPORT) 6. 로그 남기기 1. Nest js 소개 * Nest js는 효율적이고 확장 가능한 Node.js 서버 측 애플리케이션을 구축하기 위한 프레임 워크입니다. 프로그레시브 Javascript를 사용하고 TypeScript로 빌드되고 완벽하게 지원하며(개발자가 순수 JavaScript로 코딩 할 수 있음) OOP (Object Oriented Programming), FP(Functional Programming) 및 FRP (Functional Reactive Programming) 요소를 사용할 수 있..