Webpack-dev-server agent problem


this is the information I found. Here are my own settings

proxy: {
            "/qd/*": {
                target:"http://192.168.1.119:11000/psycholConsult/",
                secure: false,
                changeOrigin:true
            },
            "/logout": {
                target:"http://192.168.1.119:11000/psycholConsult/",
                secure: false,
                changeOrigin:true
            }
        }
:http://localhost/psycholConsult/bd/get  http://192.168.1.119:11000/psycholConsult/bd/get

:http://localhost/psycholConsult/logout/  http://192.168.1.119:11000/psycholConsult/

is it different from what I checked?
the following is the original link:
https://codeshelper.com/a/11.


to be honest, if you use webpack-dev-server directly, the two items are exactly the same. If there are different results, you may not be mistaken.

          options.proxy = Object.keys(options.proxy).map((context) => {
            let proxyOptions;
            // For backwards compatibility reasons.
            const correctedContext = context
              .replace(/^\*$/, '**')
              .replace(/\/\*$/, '');
              
            ...  
            
           }
            ...  

webpack/webpack-dev-server/blob/master/lib/Server.js-sharpL268

Menu