node-proxy/lib/proxy/ProxyServer.js
/**
 *  Asynchronously find the route files and invoke the specify callback to
 *  load the route files.
 *
 *  Examples:
 *    var cfgfile      = '/etc/openshift/web-proxy.json'
 *    var proxy_server = new ProxyServer(cfgfile);
 *    var routes_cfg   = proxy_server.config.routes;
 *    _asyncLoadRouteFiles(routes_cfg, function(route_files) {
 *      route_files.forEach(function(f) { proxy_server.routes.load(f); });
 *    });
 *
 *  @param  {Dict}      The routes config dictionary - indicates how to get
 *                      the list of route files.
 *  @param  {Function}  The callback to invoke.
 *  @api    private
 */
Asynchronously find the route files and invoke the specify callback to
load the route files.



@param  {Dict}      The routes config dictionary - indicates how to get
the list of route files.
@param  {Function}  The callback to invoke.
@api    private
Asynchronously find the route files and invoke the specify callback to load the route files . @param { Dict } The routes config dictionary - indicates how to get the list of route files . @param { Function } The callback to invoke . @api private
function _asyncLoadRouteFiles(routes, callback) {
  if (routes  &&  routes.cmd) {
    return child_process.exec(routes.cmd, { maxBuffer: 400 * 8192 }, function(err, stdout, stderr) {
      return callback(stdout.split('\n') );
    });
  }
  var fileset = [ ];
  if (routes  &&  routes.files) {
    fileset = routes.files;
    if ('string' === typeof routes.files) {
      fileset = [ routes.files ];
    }
  }
  return callback(fileset);
}
function _asyncLoadRouteFiles ( routes , callback ) { if ( routes && routes . cmd ) { return child_process . exec ( routes . cmd , { maxBuffer : 400 * 8192 } , function ( err , stdout , stderr ) { return callback ( stdout . split ( '\n' ) ) ; } ) ; } var fileset = [ ] ; if ( routes && routes . files ) { fileset = routes . files ; if ( 'string' === typeof routes . files ) { fileset = [ routes . files ] ; } } return callback ( fileset ) ; }
Asynchronously find the route files and invoke the specify callback to
  load the route files.
Asynchronously find the route files and invoke the specify callback to load the route files .
/*  Need to get the routes via a command, exec it and pass callback.  */ /*  Routes are in a file/list of files - set the fileset.  */ /*  Single file name - convert to a list w/ 1 entry.  */ /*  Invoke the callback w/ the list/set of files.  */