Package Exports
- @hoajs/jwt
Readme
@hoajs/jwt
JSON Web Token(JWT) middleware for Hoa.
Installation
$ npm i @hoajs/jwt --saveQuick Start
import { Hoa } from 'hoa'
import { jwt } from '@hoajs/jwt'
const app = new Hoa()
app.use(jwt({ secret: 'shhhh' }))
app.use(async (ctx) => {
ctx.res.body = `Hello, ${ctx.state.user.name}!`
})
export default appDocumentation
The documentation is available on hoa-js.com
Test (100% coverage)
$ npm testLicense
MIT