koa-sleepy

0.1.1-alpha.0 • Public • Published

koa-sleepy

NPM Version Build Status Node.js Version

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
}))

Readme

Keywords

Package Sidebar

Install

npm i koa-sleepy

Weekly Downloads

1

Version

0.1.1-alpha.0

License

MIT

Unpacked Size

68.8 kB

Total Files

14

Last publish

Collaborators

  • zf