Last active
August 29, 2015 13:57
-
-
Save lukemorton/9664608 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 '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) |
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 'lily/adapter/rack' | |
require 'lily/application/routed_application' | |
handler = RoutedApplication.new(:routes => [[:GET, '/', 'Hello world']]) | |
run Lily::Adapter::Rack::Handler.new(:handler => handler) |
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 '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