eucalypt
>= 0.9.0
>= 0.9.0
  • eucalypt
  • Installation
  • CLI
    • Core
      • Init
      • Launch
      • Console
      • Test
      • Version
      • Rake
      • Help (-H)
    • Generate
      • Controller
      • Helper
      • Model
      • Scaffold
    • Destroy
      • Controller
      • Helper
      • Model
      • Scaffold
    • Blog
      • Setup
      • Article
        • List
        • Generate
        • Destroy
        • Edit
          • Urltitle
          • Datetime
    • Migration
      • Blank
      • Types
      • Create
        • Table
      • Add
        • Index
        • Column
      • Drop
        • Table
        • Index
        • Column
      • Rename
        • Table
        • Index
        • Column
      • Change
        • Column
  • Features
    • Controllers
    • Helpers
    • Views
      • Layouts
      • Partials
    • Static data
    • Core application file
    • Configuration
      • Logging
      • Asset pipeline
        • Manifest asset files
      • Initializers
      • Database
    • Manifest accessor
    • Application path helpers
    • Blog environment
      • Articles
    • Rendering static files
    • Maintenance mode
Powered by GitBook
On this page
  1. Features

Maintenance mode

PreviousRendering static files

Last updated 6 years ago

If you wish to disable access to all routes of your application and redirect every requested route to a certain route, this can be done with a maintenance route.

This can be configured in app.rb:

app.rb
class ApplicationController < Sinatra::Base
  .
  # Set maintenance route
  maintenance enabled: true do
    erb :maintenance, layout: false
  end
  .
  .
end

This action is typically that details the reasons for maintenance:

class ApplicationController < Sinatra::Base
  .
  # Set maintenance route
  maintenance enabled: true do
    render_static '/maintenance.html'
  end
  .
  .
end

Note that maintenance simply is just a get route, so some sort of rendering, redirecting, or other valid return must be done.

rendering a static webpage