1

I have a few endpoints like below.

  • abcd/text/data
  • xyz/text/data
  • Pqr/text/data

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?

0

1 Answer 1

2

You are missing some parameters, try something like this:

    {
     "/text/*" : {

       "target": "abc"
       "secure": true,
       "changeOrigin": true,
       "pathRewrite": {
        "^/api": ""
         }
       }
    }
Sign up to request clarification or add additional context in comments.

1 Comment

Yes, this works. But how to add next url xyz/text/data in proxy file. The thing is my proxy object key "/text/*" is common for all url.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.