https://github.com/flasd/express-brute-firestore
Firestore Store for express-brute
https://github.com/flasd/express-brute-firestore
Last synced: over 1 year ago
JSON representation
Firestore Store for express-brute
- Host: GitHub
- URL: https://github.com/flasd/express-brute-firestore
- Owner: flasd
- Created: 2019-06-05T17:39:15.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T23:29:18.000Z (over 3 years ago)
- Last Synced: 2025-02-23T10:33:36.369Z (over 1 year ago)
- Language: JavaScript
- Size: 766 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
express-brute-firestore
===================
A Firestore store for [express-brute](https://github.com/AdamPflug/express-brute).
[](https://www.npmjs.com/package/express-brute-firestore)
[](https://www.npmjs.com/package/express-brute-firestore)
## Installation
Install the latest version of express-brute-firestore:
(note: this package requires NodeJs >= 7.6)
```
npm install express-brute-firestore --save
// or, with yarn
yarn add express-brute-firestore
```
## Usage
```javascript
const express = require('express');
const ExpressBrute = require('express-brute');
const FirestoreStore = require('express-brute-firestore');
const admin = require('firebase-admin');
admin.initializeApp();
const app = express();
const store = new FirestoreStore(admin.firestore(), 'BRUTE_FORCE_COLLECTION');
const bruteGuard = new ExpressBrute(store);
app.post('/unprotected-route', bruteGuard.prevent, (req, res) => { /* your usual logic */ });
```
### Copyright & License
Copyright (c) 2019 [Marcel de Oliveira Coelho](https://github.com/husscode) under the [MIT License](https://github.com/husscode/cpf-check/blob/master/LICENSE.md). Go Crazy. :rocket: