@liqiqiang/basic-auth
v1.0.1
Published
The basic auth middleware for express
Downloads
4
Readme
The basic auth middleware for express
Install
npm install @liqiqiang/basic-auth --save
Usage
before all route
const express = require('express');
const basicAuth = require('@liqiqiang/basic-auth');
const app = express();
// all route
app.use(basicAuth('user', 'password'));
app.listen(8000);
before specific route
const express = require('express');
const basicAuth = require('@liqiqiang/basic-auth');
const app = express();
// specific route
app.use('/api', basicAuth('user', 'password'));
app.listen(8000);