I like to define array of routes in my application same like in hapi so I have added option to pass array to route() function. route() accepts an object or array of objects now.
var router = require('koa-joi-router');
var public = router();
var routes = [
{
method: 'post',
path: '/users',
handler: function*(){}
},
{
method: 'get',
path: '/users',
handler: function*(){}
}
];
public.route(routes);
I like to define array of routes in my application same like in
hapi
so I have added option to pass array toroute()
function.route()
accepts an object or array of objects now.