I have an Angular webApp. It is served by server #1. And most of its data is pulled from a webservice hosting on the same server (#1).
Now I need to add a new feature which requires me to post to a rest-endpoint on a second server (#2). I have two options:
- let my front-end UI talk directly to server #2, which requires me to change cross-origin policy, OR
- add a proxy endpoint on server #1, and let my webapp talk to server #1's proxy endpoint, which in turn talk to server #2's endpoint.
Which way is a converntional way of doing this?