Skip to content

Instantly share code, notes, and snippets.

@mrjabba
Created May 12, 2012 17:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrjabba/2667691 to your computer and use it in GitHub Desktop.
Save mrjabba/2667691 to your computer and use it in GitHub Desktop.
Creating the simplest possible server in ruby using rack
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