5.4.0 • Published 1 year ago

@tadashi/koa-base v5.4.0

Weekly downloads
39
License
MIT
Repository
github
Last release
1 year ago

Koa Base

NPM version Build Status Coverage Status

Basic setup with Koa

Install

$ npm i @tadashi/koa-base

Middleware

Middleware list pre installed

Usage

import app from '@tadashi/koa-base'

const options = {
  error: true,
}

const ignore = ['cors']

app(options, ignore)
  .use(ctx => {
    ctx.throw(401)
  })
  .on('error', err => {
    console.log(err.message) // Unauthorized
  })

API

createApp( opts)

NameTypeDefaultDescription
optsobjectSee bellowMiddleware options
ignorearray[]Ignored middleware

opts

Default

{
  "error": false,
  "compress": {},
  "cors": {}
}

See the options in the middleware itself

ParameterMiddleware
error@tadashi/koa-error
compresskoa-compress
corskcors

License

MIT © Thiago Lagden

5.4.0

1 year ago

5.3.0

2 years ago

5.2.0

2 years ago

5.1.2

3 years ago

5.1.1

3 years ago

5.1.0

4 years ago

5.0.0

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.17.1

4 years ago

3.17.0

4 years ago

3.16.0

5 years ago

3.15.0

5 years ago

3.13.0

5 years ago

3.14.0

5 years ago

3.12.0

5 years ago

3.11.0

6 years ago

3.10.0

6 years ago

3.9.1

6 years ago

3.9.0

6 years ago