Skip to content

Instantly share code, notes, and snippets.

@scalp42

scalp42/base.rb Secret

Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scalp42/fc82207c5cf546e5ea24 to your computer and use it in GitHub Desktop.
Save scalp42/fc82207c5cf546e5ea24 to your computer and use it in GitHub Desktop.
Middleware loads twice
class Base < Scorched::Controller
middleware << proc do
use Rack::Session::Cookie, secret: 'mysecretcookie'
end
map pattern: '/sub', conditions: { method: 'GET' }, target: Sub
# If set after the mapping, it won't work for some reason
# middleware << proc do
# use Rack::Session::Cookie, secret: 'mysecretcookie'
# end
end
class Sub < ApiV1
get '/hello' do
'world'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment