Skip to content

Instantly share code, notes, and snippets.

@danhigham
Created August 6, 2012 17:55
Show Gist options
  • Select an option

  • Save danhigham/3277126 to your computer and use it in GitHub Desktop.

Select an option

Save danhigham/3277126 to your computer and use it in GitHub Desktop.
Serving images
require 'sinatra'
get '/hi' do
"<html><head></head><body><img src=\"/images/javelin-2012-hp.jpg\" /></body></html>"
end
get %r{/images/(.+)} do |c|
File.read(c)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment