1

I built a simple app that uses Rails for the back-end and React/Redux for front-end. I deployed the Rails app through Heroku and React/Redux app with Surge. When running these two apps locally on two different servers (Rails-3001/React-3000), I'm able to make the necessary requests from client to server side.

For example, on client-side, I type "localhost:3000/users" to make a GET request on the server side "localhost:3001/users" However, it's when I type directly on my deployed apps that I get a 404 error.

So the domain for my client-side is "simple-pen.surge.sh" and for my server-side, "simplepen-api.herokuapp.com". When I type "simple-pen.surge.sh/users", I assume the request will be resolved to hit "simplepen-api.herokuapp.com/users" on the back-end, but the error I get in my console is GET request failed for "simple-pen.surge.sh/users". Why would this work locally and not when deployed.

jamesvphan
  • 1,825
  • 6
  • 23
  • 30

0 Answers0