config.default.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 + '_1641883497557_9277';
  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: 6104,
  24. },
  25. };
  26. config.dbName = 'baoan-exam';
  27. config.mongoose = {
  28. url: `mongodb://localhost:27017/${config.dbName}`,
  29. options: {
  30. user: 'c##baoandba',
  31. pass: 'baoan2021',
  32. authSource: 'admin',
  33. useNewUrlParser: true,
  34. useCreateIndex: true,
  35. },
  36. };
  37. config.jwt = {
  38. ...jwt,
  39. expiresIn: '1d',
  40. issuer: 'baoan',
  41. };
  42. // 服务设置
  43. config.middleServer = {
  44. ip: '106.12.161.200',
  45. port: '6101',
  46. };
  47. config.filesConfig = {
  48. root_path: 'D:\\temp',
  49. project: 'exam',
  50. export_dir: 'export',
  51. };
  52. return {
  53. ...config,
  54. ...userConfig,
  55. };
  56. };