-
Notifications
You must be signed in to change notification settings - Fork 166
Expand file tree
/
Copy pathsystem.config.js
More file actions
50 lines (44 loc) · 1.37 KB
/
system.config.js
File metadata and controls
50 lines (44 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* Created by hanlu on 2017/3/24.
*/
const debug = process.env.NODE_ENV == 'development';
//服务器端口
const serverPort = '4000';
//服务器地址
//开发模式,服务器地址
const httpServerDev = 'http://localhost:'+serverPort;
//跨域请求头配置
const defaultOptionsDev = {
mode: 'cors',
credentials: 'include',
headers: {
'content-type': 'application/json'
},
};
//部署模式,服务器地址
const httpServerPro = '';
//同域请求头配置
const defaultOptionsProd = {
credentials: 'same-origin',
headers: {
'content-type': 'application/json'
},
};
//数据库地址
//开发模式数据库地址
const mongooseConnectDev = "mongodb://localhost:27017/accountSystem";
//部署模式数据库地址
const mongooseConnectPro = "mongodb://localhost:27017/accountSystem";
//上传图片后返回的服务器地址
//可以在 ./service/routes/uploadProductImg.js 中对返回图片的路径进行拼接修改
const uploadImgServerDev = 'localhost';
const uploadImgServerPro = '192.168.195.74';
module.exports = {
httpServer: debug ? httpServerDev:httpServerPro,
serverPort: serverPort,
defaultOptions: debug ? defaultOptionsDev : defaultOptionsProd,
mongooseConnect: debug ? mongooseConnectDev:mongooseConnectPro,
uploadImgServer: debug ? uploadImgServerDev:uploadImgServerPro,
//是否支持注册功能
register: debug
};