An opinionated, batteries-included toolset for efficient Koa API development
npm install koa-toolkit
The Koa Toolkit package is intended to provide a way to get a Koa server up and running with as few lines as possible while maintaining middleware flexibility.
This package is currently under development, so PRs are welcome and encouraged!
Redux Toolkit includes:
- A
createServer(port, callback)
function that returns a new Koa instance with routing and body parsing middleware. - A
createRouter(options)
function that returns a new koa router
const { createServer } = require('koa-toolkit');
const app = createServer();
app.router.get('/', async ctx => {
ctx.body = {
hello: 'world',
}
})
app.listen(3000, () => {
console.log('> Server listening!');
});