@hoajs/combine
v0.1.1
Published
Combine middleware for Hoa.
Readme
@hoajs/combine
Combine middleware for Hoa.
Installation
$ npm i @hoajs/combine --saveQuick Start
import { Hoa } from 'hoa'
import { every, some } from '@hoajs/combine'
import { RateLimiter } from '@hoajs/cloudflare-rate-limit'
import { basicAuth } from '@hoajs/basic-auth'
import { ip } from '@hoajs/ip'
const app = new Hoa()
app.use(
some(
every(
ip({ allowList: ['192.168.0.2'] }),
basicAuth({ username: 'admin', password: '123456' })
),
// If both conditions are met, RateLimiter will not execute.
RateLimiter(...)
)
)
export default appDocumentation
The documentation is available on hoa-js.com
Test (100% coverage)
$ npm testLicense
MIT
