koa-sleepy
v0.1.1-alpha.0
Published
RESTful Router for Koa
Downloads
2
Readme
koa-sleepy
router for building RESTful api
const Koa = require('koa')
const {restify} = require('koa-sleepy')
class User {
list (ctx, id) {}
create (ctx) {}
retrive (ctx, id) {}
update (ctx, id) {}
replace (ctx, id) {}
destory (ctx, id) {}
more(ctx, id) {}
}
const app = new Koa()
app.use(restify('/users', User))
app.listen()
to register multiple resources
app.use(restify({
'/users': User,
'/comments': Comment
}))