Skip to content

Commit

Permalink
Merge pull request #1 from Andoromeda-Foundation/xiaotian/dev
Browse files Browse the repository at this point in the history
Xiaotian/dev
  • Loading branch information
xiaotiandada authored Mar 23, 2022
2 parents 561a3b2 + a71efff commit 45b9e6b
Showing 1 changed file with 106 additions and 0 deletions.
106 changes: 106 additions & 0 deletions backend/config/config.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
'use strict';

/** app info */
module.exports = () => {
const config = {};
config.onerror = {
onerror: {
all(err, ctx) {
// 在此处定义针对所有响应类型的错误处理方法
// 注意,定义了 config.all 之后,其他错误处理方法不会再生效
ctx.body = 'error';
ctx.status = 500;
},
html(err, ctx) {
// html hander
ctx.body = '<h3>error</h3>';
ctx.status = 500;
},
json(err, ctx) {
// json hander
ctx.body = { message: 'error' };
ctx.status = 500;
},
jsonp(err) {
// 一般来说,不需要特殊针对 jsonp 进行错误定义,jsonp 的错误处理会自动调用 json 错误处理,并包装成 jsonp 的响应格式
},
},
};

// use for cookie sign key, should change to your own and keep security
config.keys = '';

// 请修改jwt密钥和失效时间
config.login = {
secretKey: '', // jwt密钥
expires: 60 * 60 * 24, // 超时时间24小时
username: '',
password: '',
};
config.sequelize = {
dialect: 'mysql',
hostname: '',
host: '',
port: 3306,
database: '',
username: '',
password: '',
pool: {
max: 3, // 连接池最大连接数量
min: 1, // 连接池最小连接数量
idle: 10000, // 如果一个线程超过10秒钟没有被使用过就释放该线程
},
dialectOptions: {
charset: 'utf8mb4',
multipleStatements: true,
ssl: {
rejectUnauthorized: false,
},
},
};

// Redis Config
config.redis = {
client: {
port: 6379,
host: '',
password: '',
db: 1,
},
};

// Matataki Api Url
config.matatakiServer = '';

// IPFS Config
config.ipfs_service = {
site: '',
host: '',
port: 5001,
protocol: 'http',
};

// Telegram Config
config.telegram = {
botToken: '',
};


config.matatakiApiKey = '';

// Cache Api Config
config.cacheAPI = {
uri: '',
apiToken: '',
};

// DingTalk Robot Config
config.DingTalkRobot = {
url: '',
managementPlatform: '',
};

config.securityCode = '';

return config;
};

0 comments on commit 45b9e6b

Please sign in to comment.