index.js 1.11 KB
const path = require('path');
const isProduction = process.env.NODE_ENV === 'production';

module.exports = {
  delay: 500,
  dbDir: path.join(__dirname, '../db'),
  loggers: [{
    silent: true,
    type: 'dailyfile',
    level: 'info',
    filename: 'logs/info.log',
  }, {
    silent: true,
    type: 'dailyfile',
    level: 'error',
    filename: 'logs/error.log',
  }, {
    type: 'console',
    level: 'debug',
  }]
};

if (isProduction) {
  Object.assign(module.exports, {
    database: {
      connect: {
        host: 'write.ufo.yohoops.org',
        port: '3306',
        user: 'yh_vpc_bak',
        password: 'yoho@2Y$^YpNb7hp',
        charset: 'utf8mb4',
        timezone: '+08:00'
      },
      database: 'ufo_product',
    },
    monitorReport: {
      host: '10.66.4.25',
      port: 8086,
      db: 'web_monitor',
    },
  });
} else {
  Object.assign(module.exports, {
    database: {
      connect: {
        host: '192.168.102.219',
        port: '3306',
        user: 'yh_test',
        password: 'yh_test',
        charset: 'utf8mb4',
        timezone: '+08:00'
      },
      database: 'ufo_product',
    },
  });
}