Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

louisbuchbinder/app-configure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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']);

About

Simple App Configuration Handler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published