koa-sequelize-restifier

    0.2.5 • Public • Published

    Koa/Sequelize Restifier

    Installation

    $ npm install koa-sequelize-restifier
    

    Usage

    Simple restification

    var Restifier = require( 'koa-sequelize-restifier' )
    var app = require( 'koa' )()
    var router = require( 'koa-router' )()
     
    var Job = require( './models/Job' ) //Your Sequelize model
    var restifier = new Restifier()
     
    restifier.restify( router, Job )
    // Maps the following urls
    //   GET    /jobs
    //   POST   /jobs
    //   GET    /jobs/:id
    //   PATCH  /jobs/:id
    //   DELETE /jobs/:id
     
    app.use( router.routes() )
     
    app.listen( 8888, function(){
      console.log( 'App is listening' )
    })

    This module is provided as is, without warranty. If you open a Github issue, I may consider your request.

    Keywords

    none

    Install

    npm i koa-sequelize-restifier

    DownloadsWeekly Downloads

    7

    Version

    0.2.5

    License

    Property of Josh Vanderwillik

    Last publish

    Collaborators

    • joshwillik