Skip to content

Instantly share code, notes, and snippets.

@timbophillips
Last active October 3, 2019 12:58
Show Gist options
  • Save timbophillips/640bffb52759a04dc47c0a6f3d4d9c43 to your computer and use it in GitHub Desktop.
Save timbophillips/640bffb52759a04dc47c0a6f3d4d9c43 to your computer and use it in GitHub Desktop.
Fix CORS problem using Angular (Webpack) proxy - this redirects /api to localhost:8888
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "eaglebayng:build",
"proxyConfig": "src/proxy.conf.json"
},
"configurations": {
"production": {
"browserTarget": "eaglebayng:build:production"
}
}
},
{
"/api": {
"target": "http://localhost:8888/",
"pathRewrite": {"^/api" : ""},
"secure": false
},
"logLevel": "debug"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment