Skip to content

Instantly share code, notes, and snippets.

@Wardrop
Created March 10, 2014 02:02
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 Wardrop/9458253 to your computer and use it in GitHub Desktop.
Save Wardrop/9458253 to your computer and use it in GitHub Desktop.
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