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

1.0.0 • Public • Published

express-putin

Express middleware to reject requests from all Russian IPs.

Version License Node version Dependencies Build Test

Table of contents:

Usage

Basic

import express from 'express';
import putin from 'express-putin';

const app = express();

app.use(putin());

Customize response body and/or status code

import express from 'express';
import putin from 'express-putin';

const HTTP_I_AM_A_TEAPOT = 418;

const app = express();

app.use(putin({
  body: 'Russia, please stop the war!',
  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.

Why did you name a package after a war criminal?

So that people never forget who is responsible for all this.

And because it's way more catchy than express-stop-russian-invasion-on-ukraine.


Other open-source projects to help Ukraine: https://github.com/petrussola/help-ukraine-open-source

Package Sidebar

Install

npm i express-putin

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

1.22 MB

Total Files

24

Last publish

Collaborators

  • kamilmielnik
  • yuriyyakym