Skip to content

foundersandcoders/humming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

hapi plugin to generate CRUD routes for all models in a folder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published