Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions app/controllers/errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

class ErrorsController < ApplicationController
skip_before_action :verify_authenticity_token
before_action :render_maintenance_page, except: :not_found

def bad_request
@status_code = 400
Expand Down Expand Up @@ -42,12 +41,6 @@ def service_unavailable

private

def render_maintenance_page
return unless ENV["MAINTENANCE_MODE"].present?

render file: Rails.root.join("public", "maintenance.html"), layout: false, status: 503, content_type: "text/html"
end

def render_error
respond_to do |format|
format.html { render "errors/show", status: @status_code, layout: error_layout }
Expand Down
7 changes: 0 additions & 7 deletions app/controllers/maintenance_controller.rb

This file was deleted.

4 changes: 0 additions & 4 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ class Application < Rails::Application
expire_after: 14.days,
secure: Rails.env.production?,
httponly: true

require_relative "../lib/maintenance_mode_middleware"
config.middleware.insert_before 0, MaintenanceModeMiddleware

config.middleware.use Rack::Attack
config.exceptions_app = routes
end
Expand Down
3 changes: 0 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ def matches?(request)
mount LetterOpenerWeb::Engine, at: "/letter_opener"
end

# Maintenance page (always accessible for previewing)
get "maintenance", to: "maintenance#show"

# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
# Can be used by load balancers and uptime monitors to verify that the app is live.
get "up" => "rails/health#show", as: :rails_health_check
Expand Down
17 changes: 0 additions & 17 deletions lib/maintenance_mode_middleware.rb

This file was deleted.

188 changes: 0 additions & 188 deletions public/maintenance.html

This file was deleted.