I can’t figure out why my Netlify page can’t access my RoR backend on Heroku. When I run the build folder on port 5000, it works. When I navigate to the Netlify page, it doesn’t. I see the frontend html, but nothing from my db.
Thoughts? I did include
/* /index.html 200
/api/* http://myBackend.herokuapp.com/myPath/:splat 200
in a _redirects file, and changed my fetch requests to include the proper path.
Have a look at this great Support Guide. If you have any follow-up questions, happy to look at them
Last reviewed by Netlify Support on December 2022
How do I run a server/database at Netlify?
We often get questions about how to run a specific backend server or database at Netlify. Examples of these types of questions include:
How to I get my node HTTP listener to respond to requests?
How do I start Mongo/MySQL/<insert-some-database-here> running on the server?
How can I SSH into my website?
We are here today to answer these questions - and the answer is: you can’t!
What do you m…
I think it’s a redirects problem. You’ve added a wildcard route
/* that matches all the URLs of the website. This means even your
/api/* route is actually getting redirected to
You should move your
/api/* route above the
/* route so that it gets matched before the other one.