All about cors.
This cheatsheet is inspired by the book "CORS in Action" by Monsu Hossain
CORS - cross origin resource sharing
CORS is a way of making HTTP requests from one place to another. This is a trivial thing in other programming languages, but not so much in client-side JavaScript. This cheatsheet makes it a bit easier.
-
npm i
npm start
- The client initiates the request.
- The browser adds additional information to the request and forwards it to the server.
- The server decides how to respond to the request, and sends the response to the browser.
- The browser decides whether the client should have access to the response, and either passes the response to the client or returns an error.