eucalypt
Search…
Maintenance mode
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
1
class ApplicationController < Sinatra::Base
2
.
3
# Set maintenance route
4
maintenance enabled: true do
5
erb :maintenance, layout: false
6
end
7
.
8
.
9
end
Copied!
This action is typically rendering a static webpage that details the reasons for maintenance:
1
class ApplicationController < Sinatra::Base
2
.
3
# Set maintenance route
4
maintenance enabled: true do
5
render_static '/maintenance.html'
6
end
7
.
8
.
9
end
Copied!
Note that maintenance simply is just a get route, so some sort of rendering, redirecting, or other valid return must be done.
Last modified 2yr ago
Copy link