In prod, we're having HAProxy handle diverting any request beginning with /api/ to the backend server so everything is under the same origin and we don't have to worry about CORS.
For development we're using this library to handle the proxying in combination with spa.UseAngularCliServer(npmScript: "start"); Best I can figure, this is the simplest configuration to take anything request beginning with /api/, strip off /api/, and then proxying it to the backend:
In prod, we're having HAProxy handle diverting any request beginning with
/api/
to the backend server so everything is under the same origin and we don't have to worry about CORS.For development we're using this library to handle the proxying in combination with
spa.UseAngularCliServer(npmScript: "start");
Best I can figure, this is the simplest configuration to take anything request beginning with/api/
, strip off/api/
, and then proxying it to the backend:Is there another way built-in that I'm missing?