express-browser-block
v1.1.0
Published
Express middleware to block browsers requests that do not satisfies the conditions
Downloads
4
Readme
Express Browser Block
Express middleware to block browsers requests that do not satisfies the conditions
Instalation
npm install express-browser-block
Usage
import express from 'express';
import { blockRequestIfBrowserIsNot } from 'express-browser-block';
const app = express();
app.use(blockRequestIfBrowserIsNot());
// see API definitions to overwirite default values
app.get('/hello', (req, res) => {
res.send('world');
})
app.listen(3000);
API
The blockRequestIfBrowserIsNot
functions accepts two parameters: conditions
and html
.
The conditions
parameter follows the definition of the Browser dependency.
The html
is what is going to be send to your user when it doesn't satisfies the conditions
parameter.