express-brute-pg
A PostgreSQL store for express-brute via node-postgres.
Installation
via npm:
$ npm install express-brute-pg
express-brute-pg expects a table named brute
(this may be overridden in the constructor) to exist in whatever database you're connecting to.
create table brute(id text primary key, count int, first_request timestamptz, last_request timestamptz, expires timestamptz);
Usage
var ExpressBrute =PgStore = ;var store =host: '127.0.0.1'database: 'sandbox'username: 'appuser'password: 'password';var bruteforce = store;app;
Options
host
Postgres server host name or IP addressdatabase
Database name to connect tousername
Database usernamepassword
Corresponding password, if password authentication is requiredtableName
Include to use a storage table named something other thanbrute
schemaName
Include if your storage table is in a schema other thanpublic
pool
You may pass in your application'spool
instance toexpress-brute-pg
to share connection pools or use the native bindings; if not supplied,express-brute-pg
will spin up its own pool