config.default.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. 'use strict';
  2. const path = require('path');
  3. module.exports = appInfo => {
  4. const config = exports = {};
  5. // use for cookie sign key, should change to your own and keep security
  6. config.keys = appInfo.name + '_smartcost3850888';
  7. // 数据库配置
  8. config.mysql = {
  9. client: {
  10. // host
  11. host: '127.0.0.1',
  12. // 端口号
  13. port: '3306',
  14. // 用户名
  15. user: 'zongheng',
  16. // 密码
  17. password: '@)!(smartcost#*%)',
  18. // 数据库名
  19. database: 'index_sys',
  20. },
  21. // 是否加载到 app 上,默认开启
  22. app: true,
  23. // 是否加载到 agent 上,默认关闭
  24. agent: false,
  25. };
  26. // view
  27. config.view = {
  28. mapping: {
  29. '.ejs': 'ejs',
  30. },
  31. root: [
  32. path.join(appInfo.baseDir, 'app/view'),
  33. ].join(','),
  34. };
  35. // session
  36. config.session = {
  37. key: 'ZHC_SESS',
  38. maxAge: 3600 * 1000,
  39. httpOnly: true,
  40. encrypt: true,
  41. };
  42. // 表名前缀
  43. config.tablePrefix = 'is_';
  44. // add your config here
  45. config.middleware = ['urlParse'];
  46. // 上传设置
  47. config.multipart = {
  48. whitelist: ['.xls', '.xlsx', '.json'],
  49. fileSize: '10mb',
  50. };
  51. //web-socket
  52. config.io = {
  53. init: {},
  54. namespace: {
  55. '/': {
  56. connectionMiddleware: [],
  57. packetMiddleware: [],
  58. },
  59. '/lib': {
  60. connectionMiddleware: [],
  61. packetMiddleware: [],
  62. }
  63. },
  64. redis: {
  65. // host
  66. host: '127.0.0.1',
  67. // 端口号
  68. port: '6379',
  69. // 用户名
  70. auth_pass: 'smart#*%)cost888',
  71. // 密码
  72. db: '8',
  73. }
  74. };
  75. // 是否压缩替换前端js
  76. config.min = true;
  77. return config;
  78. };