express-bootloader

bootstrap-loader is used to boot an express application : set properties, define middlewares, intialize routes, db connections, ...

Usage no npm install needed!

<script type="module">
  import expressBootloader from 'https://cdn.skypack.dev/express-bootloader';
</script>

README

bootstrap-loader

.

bootstrap-loader is an node.js module used to boot an express application :

Set application properties and db connections ...

WARNING : v0.2.0 isn't comptabible with 0.1.*

The boot-loader module need to read one configuration files (json format) :

  • bootloader.json (general configuration)

Installation

You can install it with npm :

npm install express-bootloader --save

Or you can registrer it in the package.json of your express web application

example

By default create the configuration files in a directory named "/configs"

  • bootloader.json :
{
    "bootloader" :{
        "db" : {
            "mongodb" : {
                "uri" : "mongodb://localhost/test"
            }
        },
        "settings" : {
            "port" : 3000,
            "views" : "views",
            "view engine" : "ejs"
        }
    }    
}
  • app.js :

// [...]

var bootloader = require('express-bootloader');

var app = express();

bootloader.init(app,__dirname);

// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));

// [...]