Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skunight/nestjs-fire
https://github.com/skunight/nestjs-fire
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/skunight/nestjs-fire
- Owner: skunight
- License: mit
- Created: 2019-06-25T08:41:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T07:38:46.000Z (almost 2 years ago)
- Last Synced: 2023-08-24T00:34:24.152Z (about 1 year ago)
- Language: TypeScript
- Size: 873 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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!