Skip to content

EikosPartners/RESTLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published