Guards
Guards
λ§μ΄ν¬λ‘ μλΉμ€ κ°λμ μΌλ° κ°λ μ¬μ΄μλ μ°¨μ΄κ° μμ΅λλ€. μμμΌν μ μΌν κ²μ HttpException
μ λ°μμν€λ λμ RpcException
μ μ¬μ©ν΄μΌνλ€λ κ²μ
λλ€.
info ννΈ
RpcException
ν΄λμ€λ@nestjs/microservices
ν¨ν€μ§μμ λ ΈμΆλ©λλ€.
Binding guards
λ€μμ method-scoped guardλ₯Ό μ¬μ©νλ μμ μ λλ€ (class-scopedλ μλν©λλ€).
@@filename()
@UseGuards(AuthGuard)
@MessagePattern({ cmd: 'sum' })
accumulate(data: number[]): number {
return (data || []).reduce((a, b) => a + b);
}
Last updated
Was this helpful?