config.default.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* eslint valid-jsdoc: "off" */
  2. 'use strict';
  3. const { jwt } = require('./config.secret');
  4. /**
  5. * @param {Egg.EggAppInfo} appInfo app info
  6. */
  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 + '_1579225760252_7743';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. // add your config here
  22. config.cluster = {
  23. listen: {
  24. port: 9004,
  25. },
  26. };
  27. // axios service config
  28. config.axios = {
  29. auth: { // 用户鉴权服务
  30. baseUrl: 'http://localhost:9999/api/auth/user',
  31. },
  32. };
  33. config.mongoose = {
  34. url: 'mongodb://localhost:27017/platform',
  35. options: {
  36. user: 'admin',
  37. pass: 'admin',
  38. authSource: 'admin',
  39. useNewUrlParser: true,
  40. useCreateIndex: true,
  41. useUnifiedTopology: true,
  42. },
  43. };
  44. config.jwt = {
  45. ...jwt,
  46. expiresIn: '1d',
  47. issuer: 'train',
  48. };
  49. return {
  50. ...config,
  51. ...userConfig,
  52. };
  53. };