Class: S3arch::Dashboard::Application
- Inherits:
-
Object
- Object
- S3arch::Dashboard::Application
- Defined in:
- lib/s3arch/dashboard/application.rb
Constant Summary collapse
- VIEWS_PATH =
File.('views', __dir__)
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#routes ⇒ Object
Dispatcher mount DSL contract — keep in sync with #call dispatch below.
Instance Method Details
#call(env) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/s3arch/dashboard/application.rb', line 20 def call(env) req = Rack::Request.new(env) path = req.path_info.sub(%r{^/}, '') case [req.request_method, path] when ['GET', ''], %w[GET index] index(req) when %w[POST rebuild] rebuild(req) else [404, { 'content-type' => 'text/plain' }, ['Not Found']] end end |
#routes ⇒ Object
Dispatcher mount DSL contract — keep in sync with #call dispatch below.
13 14 15 16 17 18 |
# File 'lib/s3arch/dashboard/application.rb', line 13 def routes [ { method: :get, path: '/' }, { method: :post, path: '/rebuild' } ] end |