Answers for "angular run behind proxy"

6

angular run behind proxy

# Create Proxy file proxy.conf.json in root folder with the below content

{
  "/api/*": {
    "target": "http://localhost:8080",
    "secure": false,
    "logLevel": "debug",
    "changeOrigin": true,
    "pathRewrite": { "^/api": "" } // needed if you want to change api to empty when calling your backend service
  }
}

# when you run use

ng serve --proxy-config proxy.conf.json
Posted by: Guest on June-24-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language