Created
September 16, 2014 17:21
-
-
Save CoryFoy/f2307cd08937537b4f8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This assumes you have a folder structure like the following: | |
| # - App | |
| # - myapp.rb | |
| # - secure | |
| # - foo.jpg | |
| require 'sinatra' | |
| get '/' do | |
| 'Hello, World! <img src="/image/foo.jpg" />' | |
| end | |
| get '/image/:img' do | |
| send_file File.join('secure', params[:img]), :type => 'image/jpeg', :disposition => 'inline' | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment