0

I'm starting developing a web app from Angular Seed project (https://github.com/mgechev/angular-seed). The issue I'm having is that when an HTTP client is calling the backend, hosted on Amazon, it fails. The solution is to set up CORS on the Amazon web server. Considering that the app will be hosted on the same server, so that I won't need CORS, is there any way to have a local host server which proxies any API call to Amazon during development?

I know that other Angular projects (such as generator-angular-fullstack https://github.com/angular-fullstack/generator-angular-fullstack/issues/1869 ) provide such a solution.

Thanks!

peval27
  • 1,239
  • 2
  • 14
  • 40

1 Answers1

0

Depending on which service of Amazon your backend is hosted, you can change it in the console.

For example, if you're using AWS API Gateway, this page shows how to enable CORS by changing Access-Control-Allow-Methods, Access-Control-Allow-Headers, Access-Control-Allow-Origin.

There's also a Chrome plugin you can use to enable CORS.

sshh
  • 5,964
  • 4
  • 17
  • 20