@hoajs/timeout
v0.1.0
Published
Timeout middleware for Hoa.
Readme
@hoajs/timeout
Timeout middleware for Hoa.
Installation
$ npm i @hoajs/timeout --saveQuick Start
import { Hoa } from 'hoa'
import { timeout } from '@hoajs/timeout'
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms))
const app = new Hoa()
app.use(timeout(5000))
app.use(async (ctx) => {
await delay(6000)
ctx.res.body = 'Hello, Hoa!'
})
export default appDocumentation
The documentation is available on hoa-js.com
Test (100% coverage)
$ npm testLicense
MIT
