-
koa-http-basic-auth是一款适用于koa的HTTP基本认证中间件
资源介绍
koa-http-basic-auth
安装
npm
npm install --save koa-http-basic-auth
纱
yarn add koa-http-basic-auth
用法
const Koa = require ( 'koa' ) ;
const basicAuth = require ( 'koa-http-basic-auth' ) ;
const app = new Koa ( ) ;
// Register koa-http-basic-auth middleware
app . use ( basicAuth ( {
user : 'username