Last active
February 12, 2016 01:59
-
-
Save flada-auxv/99390e6a56a5b5496287 to your computer and use it in GitHub Desktop.
hiyorime
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
| 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 |
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
| source 'https://rubygems.org' | |
| gem 'sinatra' |
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
| 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 |
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
| 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
