config.default.js 900 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 + '_1617689037805_3801';
  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: 9104,
  23. },
  24. };
  25. config.dbName = 'question';
  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. return {
  37. ...config,
  38. ...userConfig,
  39. };
  40. };