config.default.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 + '_1632050612908_5301';
  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: 6102,
  24. },
  25. };
  26. config.dbName = 'baoan-position';
  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.map = {
  38. key: '322f362741dd84dd2c3f1d03825d9371',
  39. type: 'gps',
  40. };
  41. config.jwt = {
  42. ...jwt,
  43. expiresIn: '1d',
  44. issuer: 'baoan',
  45. };
  46. // 服务设置
  47. config.dbServer = {
  48. ip: '106.12.161.200',
  49. port: '6101',
  50. };
  51. return {
  52. ...config,
  53. ...userConfig,
  54. };
  55. };