CORS For Beginners — From Zero to CORS Hero

abhinav galodha
abhinavgalodhablogs
12 min readMar 12, 2019

--

Introduction

  • Do you want to understand CORS?
  • Does it sound too complicated to understand and the explanation you find is mostly confusing and hard to follow?
  • Are you building Microservices and worried about integrating with multiple frontend application?
  • Have you encountered the following error, and never understood why the error happens?

This article will provide a simplistic explanation of CORS using real-world analogy. We will go into the details of what you need to understand & troubleshoot CORS Issue. The article will also describe how to add the CORS support in an Asp.net core web API to enable multiple clients in different domains to interact with the API. Later, we will demonstrate an interaction between a static webpage accessing an API on a different origin.

This article is the first part in a series of two articles for CORS. This part provides an introduction to CORS which will help you grasp the CORS Concept in an effortless way and allow you to better design, understand, and troubleshoot CORS issue.

In the next part, we will go into further details, write code and apply the knowledge learned in the first part to build a Client & Server application which can communicate using CORS. The link would be added for the second part once available.

Importance of CORS & How Microservices are shaping the modern…

--

--