Basic Authentication middleware for Hoa.
$ npm i @hoajs/basic-auth --saveimport { Hoa } from 'hoa'
import { basicAuth } from '@hoajs/basic-auth'
const app = new Hoa()
app.use(basicAuth({
username: 'admin',
password: '123456'
}))
app.use(async (ctx) => {
ctx.res.body = `Hello, Hoa!`
})
export default appThe documentation is available on hoa-js.com
$ npm testMIT