Is the configuration of proxyTable: {'/ api': {target:'',host:'',} replaced by the creation of an instance?

topic description

reverse proxy, does the following code still work after creating the instance create ({baseURL: ajaxUrl,timeout: 30000 withcredentials: true})? Or is it equivalent to replacing the following code

sources of topics and their own ideas

related codes

/ / Please paste the code text below (do not replace the code with pictures)
proxyTable: {

    "/api":{
        target:"https://sspai.com",
        host:"sspai.com",
        changeOrigin:true
    },
     "/v1": {
          target: "https://sspai.com/api",
          host: "sspai.com/api",
          changeOrigin:true,
      }

},

what result do you expect? What is the error message actually seen?

Jul.06,2021

as long as there is a protocol header (for example, baseURL write http://host on axios ), the browser will not automatically complete (protocol): / / host , and will not access the server where the front-end service is located (unless you write host is the same as the completion), and how can you proxy if you do not serve?

Menu