Authored by 王水玲

sale

@@ -13,28 +13,27 @@ module.exports = { @@ -13,28 +13,27 @@ module.exports = {
13 port: 6001, 13 port: 6001,
14 siteUrl: 'http://m.yohobuy.com', 14 siteUrl: 'http://m.yohobuy.com',
15 domains: { 15 domains: {
16 - 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/ 16 + api: 'http://testapi.yoho.cn:28078/',
17 service: 'http://testservice.yoho.cn:28077/', 17 service: 'http://testservice.yoho.cn:28077/',
18 - search: 'http://192.168.10.64:8080/yohosearch/'  
19 }, 18 },
20 useOneapm: false, 19 useOneapm: false,
21 useCache: false, 20 useCache: false,
22 memcache: { 21 memcache: {
23 - master: ['192.168.102.168:12580'],  
24 - slave: ['192.168.102.168:12580'],  
25 - session: ['192.168.102.168:12580'],  
26 - timeout: 5000 22 + master: ['192.168.102.161:11213'],
  23 + slave: ['192.168.102.161:11213'],
  24 + session: ['192.168.102.161:11213'],
  25 + timeout: 3000
27 }, 26 },
28 loggers: { 27 loggers: {
29 infoFile: { 28 infoFile: {
30 name: 'info', 29 name: 'info',
31 level: 'info', 30 level: 'info',
32 - filename: 'log/info.log' 31 + filename: 'logs/info.log'
33 }, 32 },
34 errorFile: { 33 errorFile: {
35 name: 'error', 34 name: 'error',
36 level: 'error', 35 level: 'error',
37 - filename: 'log/error.log', 36 + filename: 'logs/error.log',
38 handleExceptions: true 37 handleExceptions: true
39 }, 38 },
40 udp: { // send by udp 39 udp: { // send by udp
@@ -53,6 +52,16 @@ module.exports = { @@ -53,6 +52,16 @@ module.exports = {
53 if (isProduction) { 52 if (isProduction) {
54 Object.assign(module.exports, { 53 Object.assign(module.exports, {
55 appName: 'm.yohobuy.com', 54 appName: 'm.yohobuy.com',
  55 + domains: {
  56 + api: 'http://api.yoho.yohoops.org/',
  57 + service: 'http://service.yoho.yohoops.org/'
  58 + },
  59 + memcache: {
  60 + master: ['172.31.22.1:12111', '172.31.20.56:12111', '172.31.31.146:12111'],
  61 + slave: ['172.31.22.1:12112', '172.31.20.56:12112', '172.31.31.146:12112'],
  62 + session: ['172.31.22.1:12111', '172.31.20.56:12111', '172.31.31.146:12111'],
  63 + timeout: 3000
  64 + },
56 useOneapm: true, 65 useOneapm: true,
57 useCache: true 66 useCache: true
58 }); 67 });
@@ -15,8 +15,6 @@ const Timer = require('./timer'); @@ -15,8 +15,6 @@ const Timer = require('./timer');
15 const config = require('../config/common'); 15 const config = require('../config/common');
16 const api = config.domains.api; 16 const api = config.domains.api;
17 const serviceApi = config.domains.service; 17 const serviceApi = config.domains.service;
18 -const searchApi = config.domains.search;  
19 -  
20 18
21 class Http { 19 class Http {
22 20
@@ -73,7 +71,7 @@ class Http { @@ -73,7 +71,7 @@ class Http {
73 if (config.useCache && cacheOption) { 71 if (config.useCache && cacheOption) {
74 return this._requestFromCache(options, true); 72 return this._requestFromCache(options, true);
75 } 73 }
76 - return Promise.reject({ 74 + return Promise.resolve({
77 code: 500, 75 code: 500,
78 message: '接口调用失败' 76 message: '接口调用失败'
79 }); 77 });
@@ -113,7 +111,7 @@ class Http { @@ -113,7 +111,7 @@ class Http {
113 return this._requestFromAPI(options, true, reqId); 111 return this._requestFromAPI(options, true, reqId);
114 } 112 }
115 113
116 - return Promise.reject({ 114 + return Promise.resolve({
117 code: 500, 115 code: 500,
118 message: '接口调用失败' 116 message: '接口调用失败'
119 }); 117 });
@@ -181,12 +179,5 @@ class ServiceAPI extends Http { @@ -181,12 +179,5 @@ class ServiceAPI extends Http {
181 } 179 }
182 } 180 }
183 181
184 -class SearchAPI extends Http {  
185 - constructor() {  
186 - super(searchApi);  
187 - }  
188 -}  
189 -  
190 exports.API = API; 182 exports.API = API;
191 exports.ServiceAPI = ServiceAPI; 183 exports.ServiceAPI = ServiceAPI;
192 -exports.SearchAPI = SearchAPI;  
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 "winston": "^2.2.0", 49 "winston": "^2.2.0",
50 "winston-daily-rotate-file": "^1.0.1", 50 "winston-daily-rotate-file": "^1.0.1",
51 "yoho-connect-memcached": "^1.0.3", 51 "yoho-connect-memcached": "^1.0.3",
52 - "yoho-express-session": "^1.0.2" 52 + "yoho-express-session": "^1.0.3"
53 }, 53 },
54 "devDependencies": { 54 "devDependencies": {
55 "autoprefixer": "^6.3.6", 55 "autoprefixer": "^6.3.6",
  1 +{
  2 + "apps": [
  3 + {
  4 + "name": "yohobuywap-node",
  5 + "script": "app.js",
  6 + "instances": "max",
  7 + "exec_mode": "cluster",
  8 + "env": {
  9 + "PORT": 6001
  10 + }
  11 + }
  12 + ]
  13 +}