0.1.1-alpha.0 • Published 6 years ago
koa-sleepy v0.1.1-alpha.0
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
}))
0.1.1-alpha.0
6 years ago