lib/routes.js
function loadFromConfig(router, providers, sessionStore) {
  const sitesMap = siteService.sites(),
    siteHosts = _.uniq(_.map(sitesMap, 'host'));

  // iterate through the hosts
  _.each(siteHosts, hostname => {
    const sites = _.filter(sitesMap, {host: hostname}).sort(sortByDepthOfPath);

    addHost({
      router,
      hostname,
      sites,
      providers,
      sessionStore
    });
  });

  return router;
}
function loadFromConfig(router, providers, sessionStore) {
  const sitesMap = siteService.sites(),
    siteHosts = _.uniq(_.map(sitesMap, 'host'));

  // iterate through the hosts
  _.each(siteHosts, hostname => {
    const sites = _.filter(sitesMap, {host: hostname}).sort(sortByDepthOfPath);

    addHost({
      router,
      hostname,
      sites,
      providers,
      sessionStore
    });
  });

  return router;
}
function loadFromConfig ( router , providers , sessionStore ) { const sitesMap = siteService . sites ( ) , siteHosts = _ . uniq ( _ . map ( sitesMap , 'host' ) ) ; // iterate through the hosts _ . each ( siteHosts , hostname => { const sites = _ . filter ( sitesMap , { host : hostname } ) . sort ( sortByDepthOfPath ) ; addHost ( { router , hostname , sites , providers , sessionStore } ) ; } ) ; return router ; }
Loads sites config and attach the basic routes for each one.
@param {express.Router} router - Often an express app.
@param {Array} [providers]
@param {Object} [sessionStore]
@returns {*}
@example
var app = express();
require('./routes)(app);
Loads sites config and attach the basic routes for each one .