2
0

config.default.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 + '_1571378739964_3623';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.errorMongo = {
  22. details: true,
  23. };
  24. config.errorHanler = {
  25. details: true,
  26. };
  27. // add your config here
  28. config.cluster = {
  29. listen: {
  30. port: 8103,
  31. },
  32. };
  33. // mongoose config
  34. // config.mongoose = {
  35. // url: 'mongodb://127.0.0.1:27017/smart',
  36. // options: {
  37. // user: 'root',
  38. // pass: 'Ziyouyanfa#@!',
  39. // authSource: 'admin',
  40. // useNewUrlParser: true,
  41. // useCreateIndex: true,
  42. // },
  43. // };
  44. // mq config
  45. config.amqp = {
  46. client: {
  47. hostname: '127.0.0.1',
  48. username: 'wy',
  49. password: '1',
  50. vhost: 'smart',
  51. },
  52. app: true,
  53. agent: true,
  54. };
  55. config.mongoose = {
  56. url: 'mongodb://localhost:27017/smart',
  57. options: {
  58. user: 'demo',
  59. pass: 'demo',
  60. authSource: 'admin',
  61. useNewUrlParser: true,
  62. useCreateIndex: true,
  63. useUnifiedTopology: true,
  64. },
  65. };
  66. // JWT config
  67. config.jwt = {
  68. ...jwt,
  69. expiresIn: '1d',
  70. issuer: 'jobs',
  71. };
  72. return {
  73. ...config,
  74. ...userConfig,
  75. };
  76. };