common.js 1.49 KB
/**
 * 系统配置
 *
 * @author hbomb qiqi.zhou@yoho.cn
 * @date 2016/05/06
 */


const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';

module.exports = {
    port: 6001,
    siteUrl: 'http://m.yohobuy.com',
    domains: {
        api: 'http://testapi.yoho.cn:28078/', // http://devapi.yoho.cn:58078/ http://testapi.yoho.cn:28078/
        service: 'http://testservice.yoho.cn:28077/'
    },
    useOneapm: false,
    useCache: false,
    memcache: {
        master: ['192.168.102.168:12580'],
        slave: ['192.168.102.168:12580'],
        session: ['192.168.102.168:12580'],
        timeout: 5000
    },
    loggers: {
        infoFile: {
            name: 'info',
            level: 'info',
            filename: 'log/info.log'
        },
        errorFile: {
            name: 'error',
            level: 'error',
            filename: 'log/error.log',
            handleExceptions: true
        },
        udp: { // send by udp
            level: 'debug', // logger level
            host: '192.168.102.162', // influxdb host
            port: '4444'// influxdb port
        },
        console: {
            level: 'debug',
            colorize: 'all',
            prettyPrint: true
        }
    }
};

if (isProduction) {
    Object.assign(module.exports, {
        appName: 'm.yohobuy.com',
        useOneapm: true
    });
} else if (isTest) {
    Object.assign(module.exports, {
        appName: 'm.yohobuy.com for test',
        useOneapm: true
    });
}