'use strict';

// to allow mongodb host and port injection thanks
// to the EZMASTER_MONGODB_HOST_PORT environment parameter
// (docker uses it)
var mongoHostPort = process.env.EZMASTER_MONGODB_HOST_PORT || 'localhost:27017';
var publicDomain = process.env.EZMASTER_PUBLIC_DOMAIN || null;
var publicIP = process.env.EZMASTER_PUBLIC_IP || '127.0.0.1';

module.exports = {
  connectionURI: 'mongodb://' + mongoHostPort + '/ezmaster',
  collectionName: 'data',
  publicDomain: publicDomain,
  publicIP: publicIP,
  port: 35267,
  browserifyModules : [
    'vue'
    , 'vue-resource'
    , 'components/addInstance'
    , 'components/table'
    , 'vue-validator'
    , 'heartbeats'
  ],
  rootURL : '/',
  routes: [
    'route.js',
    'status.js'
  ],
  middlewares: {
    // '/' means to catch all the URLs (warning do not use '/*')
    '/': 'reverseproxy.js'
  },
  filters: ['jbj-parse'],
};

module.exports.package = require('./package.json');

'use strict';

// to allow mongodb host and port injection thanks
// to the EZMASTER_MONGODB_HOST_PORT environment parameter
// (docker uses it)
var mongoHostPort = process.env.EZMASTER_MONGODB_HOST_PORT || 'localhost:27017';
var publicDomain  = process.env.EZMASTER_PUBLIC_DOMAIN || null;
var publicIP      = process.env.EZMASTER_PUBLIC_IP || '127.0.0.1';
var baseURL       = process.env.EZMASTER_PUBLIC_DOMAIN || 'http://' + publicIP + ':35267';

module.exports = {
  connectionURI: 'mongodb://' + mongoHostPort + '/ezmaster',
  collectionName: 'data',
  publicDomain: publicDomain,
  publicIP: publicIP,
  port: 35267,
  baseURL: baseURL,
  browserifyModules : [
      'vue'
    , 'vue-resource'
    , 'components/addInstance'
    , 'components/table'
    , 'vue-validator'
    , 'heartbeats'
  ],
  rootURL : '/',
  routes: [
    'route.js',
    'status.js'
  ],
  middlewares: {
    // '/' means to catch all the URLs (warning do not use '/*')
    '/': 'reverseproxy.js'
  },
  filters: ['jbj-parse'],
};

module.exports.package = require('./package.json');

fix baseURL to have the correct display in stdout