config.default.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 + '_1571378739964_3623';
  15. // add your middleware config here
  16. config.middleware = [];
  17. // add your user config here
  18. const userConfig = {
  19. // myAppName: 'egg',
  20. };
  21. config.errorMongo = {
  22. details: true,
  23. };
  24. config.errorHanler = {
  25. details: true,
  26. };
  27. // add your config here
  28. config.cluster = {
  29. listen: {
  30. port: 8107,
  31. },
  32. };
  33. config.multipart = {
  34. fileSize: '50mb', // 文件大小
  35. mode: 'file', // 文件模式
  36. whitelist: [ '.xlsx' ], // 文件类型白名单
  37. };
  38. // mongoose config
  39. config.mongoose = {
  40. url: 'mongodb://127.0.0.1:27017/smart',
  41. options: {
  42. user: 'root',
  43. pass: 'Ziyouyanfa#@!',
  44. authSource: 'admin',
  45. useNewUrlParser: true,
  46. useCreateIndex: true,
  47. },
  48. };
  49. // JWT config
  50. config.jwt = {
  51. ...jwt,
  52. expiresIn: '1d',
  53. issuer: 'jobs',
  54. };
  55. return {
  56. ...config,
  57. ...userConfig,
  58. };
  59. };