My express server is not sending anything back to my frontend

0

Hi all, I am very stuck on this problem and I have no idea where to look for a solution anymore. I have created a React app with an express backend. The complete setup is the following:

  • One EC2 instance hosting both the frontend and backend
  • Frontend created with React on port 3000
  • Backend running node/express on port 3001
  • Installed SSL with certbot and letsencrypt
  • Serving the frontend with NGINX
  • Set-up cors on my backend, no problems with that

Now my frontend is very capable of talking to the Google Auth API via Supabase, is able to retreive data from Supabase and can also send a message to my backend, so far so good. My backend is receiving that message and able to log that message in a log file. The only thing now is that I get a connection time-out because my frontend is not receiving a message back from my backend and it is driving me crazy!

If anyone has any idea what could be the cause of this. And if any information is requested I will provide it.

Thank you in advance for anyone wanting to help me.

cobeas
asked 4 months ago130 views
1 Answer
0

How is the front end configured to talk to the backend?

Does the react app run in the browser and it needs to talk directly to the back end?

profile picture
EXPERT
answered 4 months ago
  • Yes I need the frontend to talk directly to the backend and let the backend handle the other stuff (calling api's, generating pdf files, sending emails)

    Yesterday I had it working, went to sleep, woke up and went to my site and nothing worked anymore

    The strange thing is this: I changed it so that my node/express backend is serving my static files and that works like a charm but when I want to do an API call from my frontend to my backend the error says net::ERR_CONNECTION_REFUSED all the while I can't seem to find out why it did work and suddenly not anymore

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions