nestjs-api-tools
Version:
Wrappers for convenient API development including validation, logging and i18n wrappers
12 lines (9 loc) • 330 B
text/typescript
import {UseGuards, applyDecorators} from '@nestjs/common';
import {ApplyDecoratorsType} from '../types';
import {IpAllowlistGuard} from '../guards';
/**
* Uses IpAllowlistGuard to enable requests only from allowed IPs.
*/
export const RestrictIp = (): ApplyDecoratorsType => applyDecorators(
UseGuards(IpAllowlistGuard),
);