Authored by 王水玲

sale

... ... @@ -13,28 +13,27 @@ module.exports = {
port: 6001,
siteUrl: 'http://m.yohobuy.com',
domains: {
api: 'http://192.168.102.205:8080/gateway/', // http://devapi.yoho.cn:58078/ http://testapi.yoho.cn:28078/ http://192.168.102.205:8080/gateway/
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/',
search: 'http://192.168.10.64:8080/yohosearch/'
},
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
master: ['192.168.102.161:11213'],
slave: ['192.168.102.161:11213'],
session: ['192.168.102.161:11213'],
timeout: 3000
},
loggers: {
infoFile: {
name: 'info',
level: 'info',
filename: 'log/info.log'
filename: 'logs/info.log'
},
errorFile: {
name: 'error',
level: 'error',
filename: 'log/error.log',
filename: 'logs/error.log',
handleExceptions: true
},
udp: { // send by udp
... ... @@ -53,6 +52,16 @@ module.exports = {
if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com',
domains: {
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/'
},
memcache: {
master: ['172.31.22.1:12111', '172.31.20.56:12111', '172.31.31.146:12111'],
slave: ['172.31.22.1:12112', '172.31.20.56:12112', '172.31.31.146:12112'],
session: ['172.31.22.1:12111', '172.31.20.56:12111', '172.31.31.146:12111'],
timeout: 3000
},
useOneapm: true,
useCache: true
});
... ...
... ... @@ -15,8 +15,6 @@ const Timer = require('./timer');
const config = require('../config/common');
const api = config.domains.api;
const serviceApi = config.domains.service;
const searchApi = config.domains.search;
class Http {
... ... @@ -73,7 +71,7 @@ class Http {
if (config.useCache && cacheOption) {
return this._requestFromCache(options, true);
}
return Promise.reject({
return Promise.resolve({
code: 500,
message: '接口调用失败'
});
... ... @@ -113,7 +111,7 @@ class Http {
return this._requestFromAPI(options, true, reqId);
}
return Promise.reject({
return Promise.resolve({
code: 500,
message: '接口调用失败'
});
... ... @@ -181,12 +179,5 @@ class ServiceAPI extends Http {
}
}
class SearchAPI extends Http {
constructor() {
super(searchApi);
}
}
exports.API = API;
exports.ServiceAPI = ServiceAPI;
exports.SearchAPI = SearchAPI;
... ...
... ... @@ -49,7 +49,7 @@
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.0.1",
"yoho-connect-memcached": "^1.0.3",
"yoho-express-session": "^1.0.2"
"yoho-express-session": "^1.0.3"
},
"devDependencies": {
"autoprefixer": "^6.3.6",
... ...
{
"apps": [
{
"name": "yohobuywap-node",
"script": "app.js",
"instances": "max",
"exec_mode": "cluster",
"env": {
"PORT": 6001
}
}
]
}
\ No newline at end of file
... ...