byeivan
v1.0.3
Published
commie filter in the form of an Express Server
Downloads
3
Maintainers
Readme
byeivan
Express middleware to reject requests from all Russian IPs.
Table of contents:
Installation
npm install byeivan
Usage
Basic
import express from 'express';
import byeivan from 'byeivan';
const app = express();
app.use(byeivan());
Advanced - Customize response body and/or status code
import express from 'express';
import byeivan from 'byeivan';
const HTTP_I_AM_A_TEAPOT = 418;
const app = express();
app.use(byeivan({
body: 'bye bye Ivan! Гражданин России, иди нахуй!',
status: HTTP_I_AM_A_TEAPOT,
}));
FAQ
Using behind a reverse proxy
In order to retrieve a client IP address we use request-ip library. Please check its documentation and make sure that your reverse proxy passes at least one of required headers containing client's IP address