Understanding same-origin policy and enable CORS for local development with react

Source: https://en.wikipedia.org/wiki/Same-origin_policy
  • Our webpack is running on port 3000
  • Our node server is running on port 4000
brew install haproxy
  • our node api running at port 4000
  • our webpack at port 3000
  • Start haproxy server with haproxy -f proxy.cfg from root of the react folder
  • start our node api running at port 4000
  • start our webpack at port 3000

--

--

--

Senior Staff Engineer @freshworks. Ex-McKinsey/Microsoft/Slideshare/SAP, Tech Enthusiast, Passionate about India. Opinions are mine

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhinav Dhasmana

Abhinav Dhasmana

Senior Staff Engineer @freshworks. Ex-McKinsey/Microsoft/Slideshare/SAP, Tech Enthusiast, Passionate about India. Opinions are mine

More from Medium

React Introduction

Express and React with concurrently

Dropdown problem with using UI Scaling

Change theme using Styled Components