Skip to content
Myr

README.md

This file

Path

src/middleware/basic-auth/README.md

26 lines 路 333 bytes 路 Markdown

Last changed by

fix: use `atob` for basic auth (#84)Yusuke Wadabefore adoption4c213e4

History of this file

Take it

Show the source

README.md

Basic Auth Middleware

Usage

index.js:

import { Hono } from 'hono'
import { basicAuth } from 'hono/basic-auth'

const app = new Hono()

app.use(
  '/auth/*',
  basicAuth({
    username: 'hono',
    password: 'acoolproject',
  })
)

app.get('/auth/page', (c) => {
  return c.text('You are authorized')
})

app.fire()