Access Control Allow Origin API Call Error

One problem that developers usually encounter in developing APIs is the Access-Contrl-Allow-Origin. Below is one common setup of a web application that is reliant to api services. A brief explanation on what happens during the request can be found on the video below.