Awesome server status message

Most of us we do not care about server status when server is up or down, some of us even did not care about wrong routes messages like page not found 404. recently i worked in a project and i was responsible about server side, we are using rails api as back-end, i was facing server down issue in staging due of fetching huge data from third-party and the server was very small. i used to check the server every time i got response in late and if the server is down or not i was ending up with json response if the server is not down like
{"success":true,"message":"Amyal backend server is up","version":null,"env":"development"}

I decided to render awesome html page that make me happy when the server is up instead of rendering json response.
My app was totally rails api project so i created one controller that inherits from ActionController::Base
class PagesController < ActionController::Base; end
and rest of the controllers will inherit from ActionController::API
class ApplicationController < ActionController::API; end
app/controllers/pages_controller.rb
# frozen_string_literal: trueclass PagesController < ActionController::Base# This will return not founded router pagerescue_from ActiveRecord::RecordNotFound dorender :not_foundend# Our server status actiondef status@build_revision = build_revisionrender :statusendprivate# REVISION is a file generated in current folder in server by Capistrano
# which show the commit id of the current version of the application in current folderdef build_revisionreturn unless File.file?('REVISION')file = File.open('REVISION', 'r')data = file.readfile.closedataendend
and we added some html and css code in our view
app/views/pages/status.html.erb
<!doctype html><html><head><title>Server Staus</title><meta charset="utf-8" /><meta name="robots" content="noindex" /><meta name="viewport" content="width=device-width, initial-scale=1.0"><style>body { text-align: center; padding: 150px; }h1 { font-size: 50px; }body { font: 20px Helvetica, sans-serif; color: #333; }article { display: block; text-align: left; width: 1050px; margin: 0 auto; }a { color: #dc8100; text-decoration: none; }a:hover { color: #333; text-decoration: none; }table { border-collapse: collapse; width: 100%; }th, td { text-align: left; padding: 8px; }tr:nth-child(even) {background-color: #f2f2f2;}th { background-color: #4CAF50; color: white; }</style></head><body><article><h1 style="color:Tomato;"><%=Rails.env.capitalize%> Server</h1><div><p style="color:DodgerBlue;">Amyal backend server is running, Enjoy with our api’s!</p><div style="overflow-x:auto;"><table><tr><th>Status</th><th>Environment</th><th>Message</th><th>Version</th></tr><tr><td>Running</td><td><%=Rails.env.capitalize%></td><td>Amyal backend server is up</td><td><%=@build_revision%></td></tr></table></div><p style="color:MediumSeaGreen;">— Best regards: Back-end Team</p></div></article></body></html>
Now check localhost:3000 to see the result