Skip to content

Instantly share code, notes, and snippets.

@leonardteo
Created August 11, 2012 14:10
Show Gist options
  • Save leonardteo/3324737 to your computer and use it in GitHub Desktop.
Save leonardteo/3324737 to your computer and use it in GitHub Desktop.
Ruby on Rack
# Sets up and runs a simple Rack server using WEBrick
require 'rack'
class HelloWorld
def call(env)
[200, {"Content-Type" => "text/html"}, ["Hello Rack!"]]
end
end
Rack::Server.start(:app => HelloWorld.new, :Port => 9292, :server => 'WEBrick')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment