app-configure
v0.0.1
Published
Simple App Configuration Handler
Downloads
10
Maintainers
Readme
App Configure
View On:
npm install --save app-configure
A Simple App Configuration Handler
// Simple express example
var express = require('express');
var initial = require('./path/to/initial/handler');
var middleware = require('./path/to/middleware/handler');
var routes = require('./path/to/route/handler');
var app = express();
app.configure = require('app-configure');
app
.configure(initial)
.configure(middleware)
.configure(routes)
.listen(8000);
In General
Module: Configure
configure an app-context with a handler
Parameters
| Name | Type | Description | |---------|----------|-------------------------------------------------| | handler | function | method should expect the app context | | args | array | optional array of args to call with the handler |
var app = {
doThis: function (val) { ... },
doThat: function (val) { ... },
configure: require('app-configure')
};
var handler = function (thisValue, thatValue) {
var app = this;
app.doThis(thisValue);
app.doThat(thatValue);
};
app.configure(handler, ['this', 'that']);