Skip to content

Instantly share code, notes, and snippets.

@cromwellryan
Created February 12, 2014 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cromwellryan/8959807 to your computer and use it in GitHub Desktop.
Save cromwellryan/8959807 to your computer and use it in GitHub Desktop.
# hello_world.rb
require 'rack'
require 'rack/server'
class HelloWorldApp
def self.call(env)
[ 200, {}, ['Hello World'] ]
end
end
run HelloWorldApp
require 'rack'
require 'rack/server'
class HelloWorldApp
def self.call(env)
[
200, #Status Code
{}, #Headers
['Hello World'] #Body
]
end
end
Rack::Server.start :app => HelloWorldApp, Port: 9999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment