Class: Webhookdb::Webterm::RedirectIndexHtmlToRoot
- Inherits:
-
Object
- Object
- Webhookdb::Webterm::RedirectIndexHtmlToRoot
- Defined in:
- lib/webterm/apps.rb
Constant Summary collapse
- REDIRECTS =
["", "/index.html"].freeze
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RedirectIndexHtmlToRoot
constructor
A new instance of RedirectIndexHtmlToRoot.
Constructor Details
#initialize(app) ⇒ RedirectIndexHtmlToRoot
Returns a new instance of RedirectIndexHtmlToRoot.
19 20 21 |
# File 'lib/webterm/apps.rb', line 19 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
23 24 25 26 |
# File 'lib/webterm/apps.rb', line 23 def call(env) return [302, {"Location" => "/terminal/"}, []] if REDIRECTS.include?(env[Rack::PATH_INFO]) return @app.call(env) end |