Skip to content

Instantly share code, notes, and snippets.

@alex-ross
Created May 10, 2014 20:27
Show Gist options
  • Save alex-ross/5f2ec961f0dbb5cf4239 to your computer and use it in GitHub Desktop.
Save alex-ross/5f2ec961f0dbb5cf4239 to your computer and use it in GitHub Desktop.
Simple rack application. Start with `rackup`
class App
def self.call(env)
path = env["REQUEST_PATH"]
case path
when "/"
body = "<h1>Hello,</h1><p>world!</p>"
[200, {}, [body]]
else
body = "Couldn't find any page at #{path}"
[400, {}, [body]]
end
end
end
$: << "."
require "app"
run App
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment