RESTLoader
v1.0.3
Published
easy express server
Downloads
2
Readme
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