Class: Chaplin::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Chaplin::Server
- Defined in:
- lib/chaplin/server.rb
Class Method Summary collapse
Class Method Details
.add_route(endpoint, response) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/chaplin/server.rb', line 19 def self.add_route(endpoint, response) send(endpoint.http_method, endpoint.path) do = (params || {}).merge(cookies: , session: session) response.execute(, self) end end |
.setup(project_path) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/chaplin/server.rb', line 8 def self.setup(project_path) set :public_folder, project_path + '/public' set :static_cache_control, [:public, :max_age => 300] set :show_exceptions, false error do env['sinatra.error']. + "\n" + env['sinatra.error'].backtrace.join("\n") end end |