config.test.js 925 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Mai
  6. * @date
  7. * @version
  8. */
  9. module.exports = appInfo => {
  10. const config = {};
  11. // 数据库配置
  12. config.mysql = {
  13. client: {
  14. // host
  15. host: '127.0.0.1',
  16. // 端口号
  17. port: '3306',
  18. // 用户名
  19. user: 'root',
  20. // 密码
  21. password: 'root',
  22. // 数据库名
  23. database: 'calculation',
  24. },
  25. // 是否加载到 app 上,默认开启
  26. app: true,
  27. // 是否加载到 agent 上,默认关闭
  28. agent: false,
  29. };
  30. // redis设置
  31. config.redis = {
  32. client: {
  33. host: '127.0.0.1',
  34. port: '6379',
  35. password: 'test',
  36. db: '0',
  37. },
  38. agent: true,
  39. };
  40. // 中间件
  41. config.middleware = ['urlParse', 'sortFilter', 'autoLogger'];
  42. return config;
  43. };