Skip to content

Instantly share code, notes, and snippets.

@flada-auxv
Last active February 12, 2016 01:59
Show Gist options
  • Save flada-auxv/99390e6a56a5b5496287 to your computer and use it in GitHub Desktop.
Save flada-auxv/99390e6a56a5b5496287 to your computer and use it in GitHub Desktop.
hiyorime
require 'sinatra'
require 'json'
get '/' do
redirect to('/random')
end
get '/random' do
erb '<img src="http://image.slidesharecdn.com/newyear2016agilediv-160106005903/95/2016-22-638.jpg">'
end
get '/random.jpg' do
content_type :jpg
send_file './hiyoranai.jpg', content_type: 'image/jpeg', filename: 'hiyoranai.jpg'
end
get '/random.json' do
content_type :json
{hiyori: "http://image.slidesharecdn.com/newyear2016agilediv-160106005903/95/2016-22-638.jpg"}.to_json
end
source 'https://rubygems.org'
gem 'sinatra'
GEM
remote: https://rubygems.org/
specs:
rack (1.6.4)
rack-protection (1.5.3)
rack
sinatra (1.4.7)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
tilt (2.0.2)
PLATFORMS
ruby
DEPENDENCIES
sinatra
BUNDLED WITH
1.11.2
web: bundle exec ruby app.rb -p $PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment