Created
November 25, 2013 03:47
-
-
Save hiroshi/7636022 to your computer and use it in GitHub Desktop.
sinatra boilerplate ref: http://qiita.com/hiroshi3110/items/aeae1f6c01cde0547f84
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
| get '/' do | |
| if @something_goes_wrong | |
| halt 400, "oops" | |
| end | |
| 'hello world' | |
| 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
| require 'bundler' | |
| Bundler.require | |
| $stdout.sync = true # https://devcenter.heroku.com/articles/getting-started-with-ruby#logging | |
| require './app' | |
| run Sinatra::Application |
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
| git init | |
| git add app.rb config.ru Gemfile Gemfile.lock | |
| git commit -m 'initial commit' | |
| heroku create your-app-name | |
| git push heroku master | |
| heroku open |
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment