CBP
CBP

Reputation: 35

Angular proxy config for multiple target url

I have a few endpoints like below.

I am trying to add these in proxy config file as fixing cors error.

For single url it is working fine but for all url it is not working. What should i add object key here? As text/data is common in all url.

Correction after David Gerschcovsky's response.

{

"/text/*" : {

     "secure": false,
     "changeOrigin": true,
     "logLevel": "debug",
     "pathRewrite": {
        "^/text/^": ""
    }

      }

}

How to add multiple entries with same object keys in this scenario?

Upvotes: 1

Views: 271

Answers (1)

David Gerschcovsky
David Gerschcovsky

Reputation: 121

You are missing some parameters, try something like this:

    {
     "/text/*" : {

       "target": "abc"
       "secure": true,
       "changeOrigin": true,
       "pathRewrite": {
        "^/api": ""
         }
       }
    }

Upvotes: 2

Related Questions