The react application does not send requests to Node.js

Hello. I deployed my Node.js application, it works successfully and accepts requests from the Vite React application running on local hosting. The problem occurs when I try to send a request from a deployed React application. The application cannot make a request or receive a response from the Node.js application and I am getting undefined. I changed the CORS settings on the server so that it can only receive requests from the deployed react application, in the environment variables I specified the address of my Nodier.js application, but it still did not help. Below I attach the deploy logs and the paсkage.json of the client and server and CORS settings. Please, help.
10 Replies
Percy
Percy2y ago
Project ID: ed4bf4ad-da91-43d9-8d61-bb2ebcc96e5d
sherpak
sherpakOP2y ago
ed4bf4ad-da91-43d9-8d61-bb2ebcc96e5d
Brody
Brody2y ago
can you show me the error in the browser console?
sherpak
sherpakOP2y ago
Brody
Brody2y ago
show me the specific network request that failed
sherpak
sherpakOP2y ago
Node js controller
Brody
Brody2y ago
your api is sending a 304 not modified, but your frontend code is not setup to handle that properly this wouldn't be an issue with railway im afraid
sherpak
sherpakOP2y ago
Yes, but everything works correctly on the local host. This is weird...
Brody
Brody2y ago
ah the classic, works on my machine haha im sure you will figure this out
Want results from more Discord servers?
Add your server