Tuesday 30 May 2017

Use cookies coming from Node.JS on port 8080 when developing with React.JS on port 3000

I generated a react application using create-react-app, and I run it on port 3000 (localhost:3000) when I develop.

The React App calls APIs exposed by a Node.JS server running on port 8080 (localhost:8080). The Node.JS server exposes login APIs, and it sets some cookies.

If I build the React App, and I deploy it on the public folder of the Node.JS server everything works fine.

When I run the React App with:

npm start

I can't use the cookies coming from Node.JS server after performing the login since they're coming from a different url (different port).

Did someone experience this issue?



via Alessandro

No comments:

Post a Comment