config.default.js 1.6 KB

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