You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
987 B

2 years ago
  1. 'use strict';
  2. const proxy = {
  3. '/api/admin': {
  4. target: 'https://sandbox-c.jufubao.cn',
  5. pathRewrite: {"^/api/admin": "/api/admin"},
  6. changeOrigin: true,
  7. secure: false,
  8. },
  9. '/oauth': {
  10. target: 'https://sandbox-c.jufubao.cn',
  11. pathRewrite: {"^/oauth": "/oauth"},
  12. changeOrigin: true,
  13. secure: false,
  14. }
  15. };
  16. const defaultSettings = require('./settings.js');
  17. // If your port is set to 80,
  18. // use administrator privileges to execute the command line.
  19. // For example, Mac: sudo npm run
  20. // You can change the port by the following method:
  21. // port = 9527 npm run dev OR npm run dev --port = 9527
  22. const port = process.env.port || process.env.npm_config_port || defaultSettings.port || 9527; // dev port
  23. const devServer = {
  24. port: defaultSettings.port,
  25. open: true,
  26. //host:'192.168.0.4',
  27. overlay: {
  28. warnings: true,
  29. errors: true
  30. },
  31. //proxy, //proxy与before不能共用,before优先于proxy
  32. //before: ()=> {}
  33. };
  34. module.exports = devServer;