![[NestJS] Param decorators](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FkQXd7%2FbtsBur7L7hZ%2FAAAAAAAAAAAAAAAAAAAAAKPeHFVtbIgn_DeSgKT1YdueDym_CVM3hITsADAUqC0B%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3D2Sw8UoKG6t6ohMD9gNvVu9O0WSM%253D)
Param decorators Nest는 HTTP 라우트 핸들러와 함께 사용할 수 있는 유용한 매개변수 데코레이터 세트를 제공합니다. 다음은 제공된 데코레이터와 이들이 나타내는 일반 Express(또는 Fastify) 객체의 목록과 사용 예시입니다. @Param Param은 Path Variable을 받아올 때 사용합니다. (예, /users/123) // NestJS @Param(param?: string) // ExpressJS req.params / req.params[param] import { Controller, Get, Param } from '@nestjs/common'; @Controller('users') export class UserController { @Get('/:id') ge..
![[NestJS] Controller, Provider, Module 이란?](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2F6De8R%2FbtsBup981Ep%2FAAAAAAAAAAAAAAAAAAAAABuvTBNyWLTJEj7w8as2n4ip3LuNhZ4NKy-DiGPkbrJK%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1759244399%26allow_ip%3D%26allow_referer%3D%26signature%3DTKit5%252FzHflfK4WQJzcqox2IYT%252BU%253D)
NestJS에서 사용하는 Controller, Provider, Module에 대한 간략하게 알아보겠습니다. Controllers 컨트롤러는 들어오는 요청을 처리하고 클라이언트에 응답을 반환하는 역할을 합니다. express의 라우터 같은 역할을 합니다. import { Controller, Get } from '@nestjs/common'; import { AppService } from './app.service'; @Controller() export class AppController { constructor(private readonly appService: AppService) {} @Get() getHello(): string { return this.appService.getHello();..