elephas

0.6.0 • Public • Published

elephas Circle CI Coverage Status

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

License

BSD

Readme

Keywords

Package Sidebar

Install

npm i elephas

Weekly Downloads

52

Version

0.6.0

License

BSD-3-Clause

Last publish

Collaborators

  • allanhortle
  • atridge
  • thepont