config.default.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 + '_1665483162811_546';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. // redis设置
  21. config.redis = {
  22. client: {
  23. port: 6379, // Redis port
  24. host: '127.0.0.1', // Redis host
  25. password: '123456',
  26. db: 9,
  27. },
  28. };
  29. // 进程设置
  30. config.cluster = {
  31. listen: {
  32. port: 14002,
  33. },
  34. };
  35. // 数据库设置
  36. config.dbName = 'service-email';
  37. config.mongoose = {
  38. url: `mongodb://localhost:27017/${config.dbName}`,
  39. options: {
  40. user: 'admin',
  41. pass: 'admin',
  42. authSource: 'admin',
  43. useNewUrlParser: true,
  44. useCreateIndex: true,
  45. },
  46. };
  47. // 邮件发送人
  48. config.sender = {
  49. free: {
  50. from: '福瑞科技',
  51. user: 'myhope1977@163.com', // 邮箱账号
  52. pass: 'RZGYKLOQUTRCNLEO', // 邮箱stmp授权码
  53. },
  54. tehq: {
  55. from: '天恩活泉',
  56. user: 'gzsdcsmfzyxgs@163.com',
  57. pass: 'URWCTDJNYKVOBBRN',
  58. },
  59. };
  60. // 路由设置
  61. config.routePrefix = '/semail/api';
  62. return {
  63. ...config,
  64. ...userConfig,
  65. };
  66. };