Created
May 12, 2012 17:14
-
-
Save mrjabba/2667691 to your computer and use it in GitHub Desktop.
Creating the simplest possible server in ruby using rack
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
my_rack_proc = lambda { |env| [200, {"Content-Type" => "text/plain"}, ["Hello. The time is #{Time.now}"]] } | |
puts my_rack_proc.call({}) | |
require 'rack' | |
Rack::Handler::WEBrick.run(my_rack_proc, :Port => 3000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment