ruby-on-railsrackrender.com

How can I do a health check for a Rails-based app on Render?


Render requires a /health endpoint, but when I create this in my app & deploy for the first time, I am unable to deploy because the app cannot boot without the migrations having run first.

it seems that Render.com health check needs the health endpoint to respond OK even before the migrations have run. how can I achieve this?


Solution

  • Rails 7 now includes a HealthController by default.

    We can now visit /up to check whether the app is running.

    If the application is healthy, it will return a 200 status code. If any exception occurs, it will return a 503 status code.

    Note: The health check is not checking any sub-system such as the database, caches, etc.

    https://blog.saeloun.com - A blog post about it.