/byeivan

commie filter in the form of express middleware

Primary LanguageTypeScriptMIT LicenseMIT

byeivan

Express middleware to reject requests from all Russian IPs.

Version License Node version Dependencies

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