config.default.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. const { jwt } = require('./config.secret');
  4. /**
  5. * @param {Egg.EggAppInfo} appInfo app info
  6. */
  7. module.exports = appInfo => {
  8. /**
  9. * built-in config
  10. * @type {Egg.EggAppConfig}
  11. **/
  12. const config = exports = {};
  13. // use for cookie sign key, should change to your own and keep security
  14. config.keys = appInfo.name + '_1611133759961_4798';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.cluster = {
  22. listen: {
  23. port: 9101,
  24. },
  25. };
  26. config.jwt = {
  27. ...jwt,
  28. expiresIn: '1d',
  29. issuer: 'test',
  30. };
  31. config.dbName = 'new-platform';
  32. config.mongoose = {
  33. url: `mongodb://localhost:27017/${config.dbName}`,
  34. options: {
  35. // user: 'admin',
  36. // pass: '111111',
  37. // authSource: 'admin',
  38. // useNewUrlParser: true,
  39. // useCreateIndex: true,
  40. },
  41. };
  42. config.amqp = {
  43. client: {
  44. hostname: '127.0.0.1',
  45. username: 'visit',
  46. password: 'visit',
  47. vhost: 'platform',
  48. },
  49. app: true,
  50. agent: true,
  51. };
  52. config.redis = {
  53. client: {
  54. port: 6379, // Redis port
  55. host: '127.0.0.1', // Redis host
  56. password: 123456,
  57. db: 1,
  58. },
  59. };
  60. config.session = {
  61. maxAge: 1000 * 60 * 30, // 30=>30min
  62. renew: true,
  63. };
  64. config.export = {
  65. root_path: 'D:\\workspace\\service\\service-file\\upload\\',
  66. };
  67. config.project = {
  68. mission: 'http://127.0.0.1:4001',
  69. hnhmain: 'http://127.0.0.1:9201',
  70. };
  71. return {
  72. ...config,
  73. ...userConfig,
  74. };
  75. };