node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »


metageo-core Build Status

Provides the core api metageo.


metageo-core is a hapi plugin and exposes the following properties

  • eventController - A generic event handler that event schemas can uses initaited from generic handlers. For example see the social schema
  • models - the mongoose models
  • mongoose - the mongoose instance. You should use this instance to avoid opening multiple connection to the DB.
  • utils - a few random utilities. see here

Example Usage for metageo-core inside another hapi plugin

//require an mongoose schema 
myNewEventSchema = require('myNewEventSchema')
exports.register = function(plugin, option, next){
    var core = plugin.plugins['metageo-core'];
    //create a controller for your new schema 
    controller = new (core.eventController)({model : myNewEventSchema});
    //add some routes 
      method: "GET",
      path: "/api/event/myNewEventType/{_id}",
        handler: controller.findOne

Rest API

See the full documentation here. The following endpoints are made avalible.

  • /session - manages sessions
  • /user - manages user CRUD
  • /event - forwords event CRUD to the proper handler
  • /events - aggergates events
  • /lists CRUD for lists


Tests are done with mocha.
To run npm test