var Path = require('path')
global.CONFIG = require('./index.json')
CONFIG.projectFile = (path) => Path.resolve(__dirname, '../..', path)


module.exports = function config (router) {
  for (var item of CONFIG.routerPipeline) {
    require(item).mount(router)
  }
}

var Path = require('path')
global.CONFIG = require('./index.json')
CONFIG.projectFile = (path) => Path.resolve(__dirname, '../..', path)


module.exports = function config (router) {

  //
  // Foundational config should be seldom used,
  // as it has a HIGH priority over the rest.
  //
  for (var item of (CONFIG.foundational || [])) {
    require(item).mount(router)
  }

  //
  // Run the rest of all configuration.
  //
  for (var item of CONFIG.routerPipeline) {
    require(item).mount(router)
  }
}

Add foundational config, for high priority config.
Add foundational config, for high priority config.

This allows setup such as typescript to always be in front,
removing the potential for user errors.
