require('log4js').configure(require('path').join(__dirname, 'log4js.json'))
var config = {
  development: {
    debug: true,
    lng: 'zh_CN',
    port: 3000,
    db: 'mysql://root:123@api.h5.jamma.cn/bank',
    mqtt: 'mqtt://root:123@api.h5.jamma.cn',
    modules: {
      bank: {
        module: process.cwd() + '/lib'
      },
      'jm-bank-mqtt': {}
    }
  },
  production: {
    debug: false,
    lng: 'zh_CN',
    port: 80,
    modules: {
      bank: {
        module: process.cwd() + '/lib'
      },
      'jm-bank-mqtt': {}
    }
  }
}

var env = process.env.NODE_ENV || 'development'
config = config[env] || config['development']
config.env = env

if (process.env['disableMQTT']) delete config.modules['jm-bank-mqtt']

module.exports = config
