elephas
v0.6.0
Published
Some added sugar on top of express to give our our some sensible defaults and a little structure.
Downloads
28
Readme
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 = {
__dirname: __dirname,
server: {
port: 3000,
cluster: false
},
httpsOnly: process.env.NODE_ENV === 'production'
};
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) {
// Do some stuff here
done(); // Let elephas know when you have finished
}
});
####List of hooks (in order of execution)
- beforeServices
- beforeMiddleware
- beforeRoutes
- afterRoutes
- onComplete
Testing
npm test