config.default.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. const { jwt } = require('./config.secret');
  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 + '_1615359726812_6846';
  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: 9103,
  24. },
  25. };
  26. config.dbName = 'new-platform';
  27. config.mongoose = {
  28. url: `mongodb://localhost:27017/${config.dbName}`,
  29. options: {
  30. // user: 'admin',
  31. // pass: '111111',
  32. // authSource: 'admin',
  33. // useNewUrlParser: true,
  34. // useCreateIndex: true,
  35. },
  36. };
  37. config.amqp = {
  38. client: {
  39. hostname: '127.0.0.1',
  40. username: 'visit',
  41. password: 'visit',
  42. vhost: 'platform',
  43. },
  44. app: true,
  45. agent: true,
  46. };
  47. config.redis = {
  48. client: {
  49. port: 6379, // Redis port
  50. host: '127.0.0.1', // Redis host
  51. password: 123456,
  52. db: 1,
  53. },
  54. };
  55. config.project = {
  56. mission: 'http://127.0.0.1:4001',
  57. live: 'http://127.0.0.1:9101/api/live/v0',
  58. site: 'http://127.0.0.1:9102',
  59. };
  60. config.jwt = {
  61. ...jwt,
  62. expiresIn: '1d',
  63. issuer: 'test',
  64. };
  65. return {
  66. ...config,
  67. ...userConfig,
  68. };
  69. };