metageo-core
Provides the core api metageo.
Usage
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 schemamyNewEventSchema =exports{var core = pluginplugins'metageo-core';//create a controller for your new schemacontroller = new coreeventControllermodel : myNewEventSchema;//add some routesplugin;}
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
Tests are done with mocha.
To run npm test