Handle CORS issues in Fastapi

Photo by Tuyen Vo on Unsplash

When using REST API in front-end recently, I met an issue when front-end keep throwing error

this issue turns out to be a problem due to CORS.