config.default.js
2.87 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* eslint valid-jsdoc: "off" */
'use strict';
/**
* @param {Egg.EggAppInfo} appInfo app info
*/
module.exports = appInfo => {
/**
* built-in config
* @type {Egg.EggAppConfig}
**/
const config = exports = {};
config.cluster = {
listen: {
port: 7009,
},
};
// use for cookie sign key, should change to your own and keep security
config.keys = appInfo.name + '_1644800905769_2309';
// add your middleware config here
config.middleware = [];
config.security = {
csrf: {
enable: false,
ignoreJSON: true,
},
};
config.cors = {
origin: '*',
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
};
// config.sequelize = {
// host: 'localhost',
// port: '5432',
// username: 'postgres',
// password: 'wawjr1314',
// database: 'ddn',
// dialect: 'postgres',
// pool: {
// max: 5,
// min: 0,
// idle: 10000,
// },
// logging: false,
// };
config.sequelize = {
// In a real app, you should keep the database connection URL as an environment variable.
// But for this example, we will just use a local SQLite database.
// const sequelize = new Sequelize(process.env.DB_CONNECTION_URL);
dialect: 'sqlite',
storage: './database/ddn-ui-dev.db',
logQueryParameters: true,
benchmark: true,
logging: false,
// Specify options, which are used when sequelize.define is called.
// The following example:
// define: { timestamps: false }
// is basically the same as:
// Model.init(attributes, { timestamps: false });
// sequelize.define(name, attributes, { timestamps: false });
// so defining the timestamps for each model will be not necessary
define: {
underscored: true, // 该选项在 egg-sequelize 里是默认选项
// freezeTableName: false,
// charset: 'utf8',
// dialectOptions: {
// collate: 'utf8_general_ci'
// },
timestamps: true,
},
// similar for sync: you can define this to always force sync for models
// sync: { force: true },
// pool configuration used to pool database connections
pool: {
max: 5,
idle: 30000,
acquire: 60000,
},
};
// config.ed25519Address = 'DFy6P2sN1KLDNtppnqLBPWcnH8GTJRouGj'; // 旧网接收钱包地址 弃用
// config.naclSecret = 'puzzle elite rescue gun blush top floor surge injury popular pole inquiry'; // 新网转账钱包秘钥
// // config.ed25519Url = 'http://120.24.69.99:8001'; // 旧网节点地址 弃用
// config.naclUrl = 'http://8.142.20.158:8001'; // 新网节点地址
// // config.naclUrl = 'http://localhost:8001'; // 测试地址
// config.ed25519NetHash = 'b11fa2f2';// 旧网nethash
// config.naclNetHash = '0ab796cd'; // 新网nethash
// add your user config here
const userConfig = {
// myAppName: 'egg',
};
return {
...config,
...userConfig,
};
};