byeivan
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Dependencies (3)

Dev Dependencies (15)

Package Sidebar

Install

npm i byeivan

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

4.09 kB

Total Files

3

Last publish

Collaborators

  • parhams