basic-auth
- File:README.md
- File:basic-auth.test.ts
- File:basic-auth.ts
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()