Mateusz
Mateusz

Reputation: 41

Can't connect Angular app to Java backend

I have a backend at: example.com/ab

I would like to connect my local Angular environment to it

My proxy configuration:

{
  "/ab": {
    "target": "http://example.com/ab",
    "secure": false,
    "changeOrigin": true,
    "logLevel": "debug"
  }
}

But I get:

enter image description here

How to configure the proxy properly?

Upvotes: 0

Views: 76

Answers (1)

Arnaud Denoyelle
Arnaud Denoyelle

Reputation: 31263

(This should be a comment but I don't have enough place)

Can you try :

  {
    "context": [
      '/ab',
    ],
    "target": "http://example.com",
    "secure": false,
    "changeOrigin": true,
    "logLevel": "debug"
  }

Upvotes: 1

Related Questions