Search code examples
apiherokumaintenance-mode

How to implement maintenance mode for Heroku API


I want to use the maintenance mode on Heroku.

But for an API, the maintenance mode does not seem to work. My API calls are stopped in their tracks because there is no header 'Access-Control-Allow-Origin' present. So there is no way to know if the API is in maintenance mode—or if it's just not responding.

Is there a way to use the Heroku maintenance mode when the app is an API?


Solution

  • Currently, unfortunately not. When you set a custom maintenance page it gets embedded as an iframe within a Heroku-served HTML page. As you've identified, the CORS headers are not set so your API client won't even fetch the page.

    See Is there a way to have a Heroku error/maintenance url served directly without the iframe