config.max.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { CoolConfig } from '@cool-midway/core';
  2. import { MidwayConfig } from '@midwayjs/core';
  3. /**
  4. * 本地开发 npm run dev 读取的配置文件
  5. */
  6. export default {
  7. typeorm: {
  8. dataSource: {
  9. default: {
  10. type: 'mysql',
  11. host: '192.168.2.101',
  12. port: 6806,
  13. username: 'root',
  14. password: 'admin',
  15. // host: '127.0.0.1',
  16. // port: 3390,
  17. // username: 'root',
  18. // password: '123456',
  19. database: 'va',
  20. // 自动建表 注意:线上部署的时候不要使用,有可能导致数据丢失
  21. synchronize: true,
  22. // 打印日志
  23. logging: false,
  24. // 字符集
  25. charset: 'utf8mb4',
  26. // 是否开启缓存
  27. cache: true,
  28. // 实体路径
  29. entities: ['**/modules/*/entity'],
  30. },
  31. },
  32. },
  33. callback: {
  34. sunpay: 'http://localhost:8000/payment/webhook/sunpay',
  35. },
  36. cool: {
  37. // 实体与路径,跟生成代码、前端请求、swagger文档相关 注意:线上不建议开启,以免暴露敏感信息
  38. eps: true,
  39. // 是否自动导入模块数据库
  40. initDB: true,
  41. // 判断是否初始化的方式
  42. initJudge: 'db',
  43. // 是否自动导入模块菜单
  44. initMenu: true,
  45. } as CoolConfig,
  46. } as MidwayConfig;