elephas
Some added sugar on top of express to give our app some sensible defaults and a little structure.
Install
npm install elephas --save
Quick Start
var config = {
server: {
port: 3000
}
};
var elephas = require('elephas')(config);
elephas.createServer();
###Options
...
###Hooks
Using the following hooks, you can jump in between each stage of the boot process to run your own code. You MUST execute the done()
callback so that the boot process can continue. All hooks are optional.
elephas.createServer({
beforeRoutes: function(done, app) {
done();
}
});
####List of hooks (in order of execution)
- beforeServices
- beforeMiddleware
- beforeRoutes
- beforeStartServer
- onComplete
##Logging
A winston logger.
var logger = require('elephas/lib/logger');
logger.info('Info message');
logger.warn('Warning message');
logger.error('Error message');
Testing
npm test
License
BSD