config.default.js 926 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 + '_1635992838175_1417';
  14. // add your middleware config here
  15. config.middleware = [];
  16. // add your user config here
  17. const userConfig = {
  18. // myAppName: 'egg',
  19. };
  20. config.routePrefix = '/api/util/dbInit';
  21. config.cluster = {
  22. listen: {
  23. port: 6900,
  24. },
  25. };
  26. config.dbName = 'dbInit';
  27. config.mongoose = {
  28. url: `mongodb://127.0.0.1:27017/${config.dbName}`,
  29. options: {
  30. user: 'admin',
  31. pass: 'admin',
  32. authSource: 'admin',
  33. useNewUrlParser: true,
  34. useCreateIndex: true,
  35. },
  36. };
  37. return {
  38. ...config,
  39. ...userConfig,
  40. };
  41. };