config.default.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. /**
  4. * @param {Egg.EggAppInfo} appInfo app info
  5. */
  6. module.exports = appInfo => {
  7. /**
  8. * built-in config
  9. * @type {Egg.EggAppConfig}
  10. **/
  11. const config = exports = {};
  12. // use for cookie sign key, should change to your own and keep security
  13. config.keys = appInfo.name + '_1611907459516_421';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. config.cluster = {
  21. listen: {
  22. port: 9102,
  23. },
  24. };
  25. config.dbName = 'statistics';
  26. config.mongoose = {
  27. url: `mongodb://localhost:27017/${config.dbName}`,
  28. options: {
  29. // user: 'admin',
  30. // pass: '111111',
  31. // authSource: 'admin',
  32. // useNewUrlParser: true,
  33. // useCreateIndex: true,
  34. },
  35. };
  36. config.redis = {
  37. client: {
  38. port: 6379, // Redis port
  39. host: '127.0.0.1', // Redis host
  40. password: 123456,
  41. db: 0,
  42. },
  43. };
  44. config.proxy = true;
  45. return {
  46. ...config,
  47. ...userConfig,
  48. };
  49. };