humming
v1.0.3
Published
hapi plugin to generate crud routes for all models in a folder
Downloads
2
Readme
marble-run
hapi plugin to generate CRUD routes for all models in a folder
use
var hapi = require("hapi");
var server = hapi.createServer();
server.connections({ port: 8000 });
server.register({
register: require("marble-run"),
options: {
modelsPath: "/models",
adapter: require("russian-doll")
}
}, function (e) {
server.start();
});
api
marble-run is registered using hapi's server.register();
method.
You may pass a modelsPath
option to point marble-run at where to find your models.
You must pass an adapter
option. The adapter must contain a function that takes a database
and a collection
parameter and returns an object with a .create
, .update
, .delete
, and .findOne
method.
license
MIT