/* eslint valid-jsdoc: "off" */ const path = require('path'); /** * @param {Egg.EggAppInfo} appInfo app info */ module.exports = appInfo => { /** * built-in config * @type {Egg.EggAppConfig} **/ const config = exports = {}; // use for cookie sign key, should change to your own and keep security config.keys = appInfo.name + '_1738834822345_7260'; // add your user config here const userConfig = { // myAppName: 'egg', }; config.static = { prefix: '/', dir: path.join(appInfo.baseDir, 'app/assets'),index: 'index.html',index: ['index.html'] }; config.middleware = ['formatResponse']; config.cors = { origin: '*', allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH' }; config.redis = { clients: { express:{ port: 6379, // Redis 端口 host: '47.100.78.112', // Redis 地址 password: 'qwe2019', // Redis 密码 db: 2, // Redis 数据库索引 }, cache:{ port: 6379, host: '127.0.0.1', password: 'qwe2019', db: 2, }, post_order_cache:{ port: 6379, host: '127.0.0.1', password: 'qwe2019', db: 5, }, wms_cache:{ port: 6379, host: '127.0.0.1', password: 'qwe2019', db: 9, } } }; config.io = { init:{ wsEngine: 'ws', }, namespace:{ '/':{ packetMiddleware: [], connectionMiddleware:["connection"] }, }, redis: { host: '127.0.0.1', password: 'qwe2019', port: 6379, db: 4, } } config.security = { csrf: { enable: false, }, }; config.mysql = { clients: { // clientId, 获取client实例,需要通过 app.mysql.get('clientId') 获取 dblocal: { // host host: '127.0.0.1', // 端口号 port: '3306', // 用户名 user: 'ye4s', // 密码 password: 'H@8h^QE4N$L.F_*', // 数据库名 database: 'ye4s', // 兼容 MySQL 8.0+ caching_sha2_password ssl: { rejectUnauthorized: false } }, dbwms: { // host host: 'ye4s.com', // 端口号 port: '3306', // 用户名 user: 'xiaowuge', // 密码 password: 'Xiaowuge@123456', // 数据库名 database: 'ye4s' }, // ... }, // 所有数据库配置的默认值 default: {}, // 是否加载到 app 上,默认开启 app: true, // 是否加载到 agent 上,默认关闭 agent: false, }; return { ...config, ...userConfig, }; };