Decorators
Controller
@Controller("/prefix") // Class-level route prefix@Controller() // Default: "/"Route Methods
@Get("/path") // GET request@Post("/path") // POST request@Put("/path") // PUT request@Delete("/path") // DELETE request@Patch("/path") // PATCH requestParameters
@Body() // Request body (auto-parsed JSON)@Body(CreateUserDto) // Body validated against DTO@Param() // URL parameter (e.g., /users/:id)@Query() // Query string parameter@Headers() // All request headers@Req() // Full Context objectModule
@Module({ controllers: [UserController], providers: [UserService], imports: [DatabaseModule], exports: [UserService],})Injectable
@Injectable("singleton") // Default@Injectable("transient")@Injectable("request")Guards
@UseGuard(AuthGuard, AdminGuard)
// Class-level:@UseGuard(AuthGuard)@Controller("/admin")
// Method-level:@Get("/secret")@UseGuard(AdminGuard)secretData() { ... }Interceptors
@UseInterceptor(LoggingInterceptor, CacheInterceptor)
@Controller("/users")@UseInterceptor(LoggingInterceptor)export class UserController { @Get("/") @UseInterceptor(CacheInterceptor) findAll() { ... }}