06. 가드와 유저 인증
NestJs의 가드(Guard)는 요청이 특정 조건을 만족하는지 확인하여 요청을 처리할지 여부를 결정하는 데 사용된다. 이를 통해 인증/인가 및 기타 요청 전 조건을 쉽게 설정할 수 있다. 가드는 미들웨어와 유사하지만 실행 컨텍스트 인스턴스에 접근할 수 있어 더 세밀한 컨트롤을 제공한다.// 글로벌 가드async function bootstrap() { const app = await NestFactory.create(AppModule); app.useGlobalGuards(new AuthGuard()); await app.listen(3000);}// 컨트롤러 가드@Controller('')@UseGuards(AuthGuard)export class Controller { @Get() find..