Skip to content

Repository files navigation

@hoajs/basic-auth

Basic Authentication middleware for Hoa.

Installation

$ npm i @hoajs/basic-auth --save

Quick Start

import { 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 app

Documentation

The documentation is available on hoa-js.com

Test (100% coverage)

$ npm test

License

MIT

About

Basic-authentication middleware for Hoa.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages