Redux data loseing/refreshing when page refreshed

Hello I’m tring to deploy my MERN stack app but unfortunally I can’t config the render environment to make it work. Beacuse when i host myself on a localhost Redux data NOT refreshing when i refresh the page. I got this issue only when deploy. I added Redirect/Rewrite path as it the instruction for the routes (it work). Do I have to add any Headers configs in frontend ?
Can you please help me sort it ?

That’s my CORS configs:

const corsOptions = {
origin: “https://my-frontend-url.onrender.com”,
methods: “GET,PUT,POST,DELETE”,
optionsSuccessStatus: 200,
allowedHeaders: “Content-Type, Authorization”,
credentials: true,
maxAge: 7200,
};

app.use(cors(corsOptions));

Hi

I’ve replied to the ticket you also opened. Let’s keep the conversation in one place (on the ticket). Then you can update this post when we get to the solution.

Alan

I don’t thing it gonna work in render.com beacuse it request proxy which render dosen’t support it.

i tried to host the backend on render and the frontend mysleft.

When i set proxy on frontend and use axios.get(‘/api/v1/products’) redux states SAVEING on refresh but when i remove the proxy and start useing the whole link redux NOT SAVEING on refresh. (for example axios.get(https://my-web-api.onredner.com/api/v1/products)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.