common.js 3.17 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 = {
    app: 'h5',
    appVersion: '4.6.0', // 调用api的版本
    port: 6004,
    siteUrl: '//m.yohoblk.com',
    signExtend: {
        app_type: 1
    },
    domains: {
        // api: 'http://192.168.102.202:8080/gateway/',
        // service: 'http://192.168.102.202:8080/gateway/',
        api: 'http://testapi.yoho.cn:28078/',
        service: 'http://testservice.yoho.cn:28077/'

        // api: 'http://devapi.yoho.cn:58078/',
        // service: 'http://devservice.yoho.cn:58077/'
    },
    subDomains: {
        host: '.m.yohoblk.com',
        default: '//m.yohoblk.com',
        guang: '//guang.m.yohoblk.com',
        list: '//list.m.yohoblk.com',
        search: '//search.m.yohoblk.com',
        huodong: '//huodong.m.yohoblk.com',
        activity: '//activity.yohoblk.com',
        index: '//m.yohoblk.com'
    },
    useOneapm: false,
    useCache: false,
    memcache: {
        master: ['192.168.102.205:12111'],
        slave: ['192.168.102.205:12111'],
        session: ['192.168.102.205:12111'],
        timeout: 1000,
        retries: 0
    },
    loggers: {
        infoFile: {
            name: 'info',
            level: 'info',
            filename: 'logs/info.log'
        },
        errorFile: {
            name: 'error',
            level: 'error',
            filename: 'logs/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
        }
    },
    thirdLogin: {
        wechat: {
            appID: 'wx75e5a7c0c88e45c2',
            appSecret: 'ce21ae4a3f93852279175a167e54509b'
        }
    }
};

if (isProduction) {
    Object.assign(module.exports, {
        appName: 'm.yohoblk.com',
        domains: {
            api: 'http://api.yoho.yohoops.org/',
            service: 'http://service.yoho.yohoops.org/'
        },
        memcache: {
            master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
            slave: ['memcache1.yohoops.org:12112', 'memcache2.yohoops.org:12112', 'memcache3.yohoops.org:12112'],
            session: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
            timeout: 1000,
            retries: 0
        },
        useOneapm: true,
        useCache: true
    });
} else if (isTest) {
    Object.assign(module.exports, {
        appName: 'm.yohoblk.com for test',
        domains: {
            api: 'http://testapi.yoho.cn:28078/',
            service: 'http://testservice.yoho.cn:28077/'
        },
        memcache: {
            master: ['127.0.0.1:12111'],
            slave: ['127.0.0.1:12112'],
            session: ['127.0.0.1:12111'],
            timeout: 1000,
            retries: 0
        },
        useOneapm: true,
        useCache: true
    });
}