The /api will always be statically prepended to all the requests and finally, when the whole application is deployed to the production, using a load balancer, we'll integrate the front end with the backend API server by putting them on / and /api respectively. This is one awesome thing because, in the backend team, we use /api/Controller/Action type of URLs for all the API calls. Recently (not really recent though), React JS's Create React App added a new feature to proxy the API requests, so that you don't get into the hassle of getting the CORS issue or changing the architecture for the production version of the API. Now everyone knows that I am the laziest developer to not check the docs and features, so I miss out a lot of great things.
0 Comments
Leave a Reply. |