Skip to content

Instantly share code, notes, and snippets.

@dmgarland
Created April 30, 2014 10:06
Show Gist options
  • Save dmgarland/338f13ce1898fbd48410 to your computer and use it in GitHub Desktop.
Save dmgarland/338f13ce1898fbd48410 to your computer and use it in GitHub Desktop.
class MyAmazingWebApp
@@headers = {
"Content-Type" => "text/html",
"My-Amazing-Header" => "coolbeans"
}.freeze
def call(env)
begin
[200, @@headers, File.open("public#{env['PATH_INFO']}")]
rescue Errno::ENOENT => e
[404, @@headers, ["Sorry couldn't find your file #{e.message}"]]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment