Created
March 10, 2014 02:02
-
-
Save Wardrop/9458253 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'scorched' | |
class Base < Scorched::Controller | |
middleware << proc do | |
use Rack::Session::Cookie, secret: 'mysecretcookie' | |
end | |
end | |
class Sub < Base | |
get '/hello' do | |
session['hello'] = rand | |
'world' | |
end | |
end | |
class Root < Base | |
map pattern: '/sub', conditions: { method: 'GET' }, target: Sub | |
end | |
run Root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment