Skip to content

Instantly share code, notes, and snippets.

@lukemorton
Last active August 29, 2015 13:57
Show Gist options
  • Save lukemorton/9664608 to your computer and use it in GitHub Desktop.
Save lukemorton/9664608 to your computer and use it in GitHub Desktop.
require 'lily/adapter/rack'
require 'lily/application/routed_application'
handler = RoutedApplication.new(:routes => [[:GET, '/', 'Hello world']])
run Lily::Adapter::Rack::Handler.new(:handler => handler)
# Or closer to PHP version: Lily::Adapter::Rack.new(:runner => method(:run)).run(:handler => handler)
require 'lily/adapter/rack'
require 'lily/application/routed_application'
handler = RoutedApplication.new(:routes => [[:GET, '/', 'Hello world']])
run Lily::Adapter::Rack::Handler.new(:handler => handler)
require 'lily/adapter/rack'
require 'lily/util/response'
class Application
include Lily::Util::Response
def call(request)
ok("Hello World")
end
end
run Lily::Adapter::Rack::Handler.new(:handler => Application.new)
# Or closer to PHP version: Lily::Adapter::Rack.new(:runner => method(:run)).run(:handler => Application.new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment