RESTLoader

1.0.3 • Public • Published

Usage

 
$ npm install --save EikosPartners/RESTLoader
 
var app = express(),
    routes = [];
var loader = require("RESTLoader")
routes.push(require('./Module'));
loader.load(app,routes);
 
--------------------------------------------------
module a sample module
--------------------------------------------------
API: {
 
        '/sampleEndPoint/:id': {
            type: 'get',
            desc: 'sample get endpoint',
            responder: function (req, res, next) {
                source.get(loader.respond(req, res));
            }
        },
        '/sampleEndPoint/:id': {
            type: 'post',
            desc: 'sends a post to an endpoint',
            responder: function (req, res, next) {
                source.saveMany(req, next);
            }
        }
};
 

Linting
---

Linted with jshint

```sh
$ npm run lint

Testing

Tested with mocha

$ npm test

Documentation

Documented with jsdoc

$ npm run docs

Package Sidebar

Install

npm i RESTLoader

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • egucciar
  • zdonato
  • dantanzer
  • lshapz