Heroku, ( - ) , , MAINTENANCE. , JSON.
, Rack app call. ( Sinatra . Ruby on Rails app .)
if ENV['MAINTENANCE']
status = '503'
headers = {'Content-Type' => 'application/json'}
body = ['{"message":"The server is undergoing maintenance. Please try again later."}']
return [status, headers, body]
end
, " , " MAINTENANCE , .
heroku config:set MAINTENANCE=1
" ", MAINTENANCE.
heroku config:unset MAINTENANCE
Voila! JSON REST API.