JSON response formatting middleware for Hoa.
$ npm i @hoajs/json --saveimport { Hoa } from 'hoa'
import { json } from '@hoajs/json'
const app = new Hoa()
app.use(json())
app.use(async (ctx) => {
ctx.res.body = 'Hello, Hoa!'
})
export default appResponse:
{
code: 200,
data: 'Hello, Hoa!'
}The documentation is available on hoa-js.com
$ npm testMIT