Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skunight/nestjs-fire


https://github.com/skunight/nestjs-fire

Last synced: 10 days ago
JSON representation

Awesome Lists containing this project

README

        

# Nestjs FireWall

FireWall guard with black or white list for NestJs.

### Installation

**Yarn**
```bash
yarn add nestjs-fire
```

**NPM**
```bash
npm install nestjs-fire --save
```

### Getting Started

```typescript
import { Controller, Get, UseGuards } from '@nestjs/common'
import { IPs, WhiteListGuard, BlackListGuard } from 'nestjs-fire'

@IPs('127.0.0.1')
OR
@Hosts('www.xxx.com')
@UseGuards(BlackListGuard)
@Controller('')
export class TestController {

@IPs('127.0.0.1')
OR
@Hosts('www.xxx.com')
@UseGuards(BlackListGuard)
@Get()
root() {
return xxx
}
}
```
That's it!