I deployed a rails app on Heroku. Everything was working fine. I pushed the code to Heroku master, and everything worked as expected. I also ran Heroku run rails db:migrate
. No errors were thrown. I can even run the Heroku run rails console
, and create objects, no problem. However, It does tell me that I have to type in User.connection, (Users are the only models I have in the app right now). When I type Heroku config
I get expected output. Everything seems perfect. But, when I open the app, it says that the page is not found:
No webpage was found for the web address: https://my-api.herokuapp.com/
It's probably worth mentioning that It's a rails API, therefore, there are no views, and no root page. But despite that, I still don't get any responses when I make API calls with Postman. I simply get a 404 response. I would at least imagine that HTTP requests would work, but they don't. Any idea why?
Upon loading the app the logs say:
ActionController::RoutingError (No route matches [GET] "/"):
Does mean there is no root route? I thought for an API, there didn't need to be one?
ActionController::RoutingError (No route matches [GET] "/"):
It means that it is pointing to your app and search for root route but if that isn't defined in the routes file then it will show this error.
For API mode only means that it will not generate css and coffee files related to controllers.
Open App links to app and finds the root path and if it doesn't find then it this error occur. Since you are using API mode thus this error will not be troublesome.