Created
March 11, 2010 01:49
-
-
Save TomV/328707 to your computer and use it in GitHub Desktop.
This file contains 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
# The following sample code doesn't work for me - any ideas on what I need to change? | |
# (you need a hoptoad API key to run this.. | |
require 'rubygems' | |
require 'sinatra/base' | |
require 'rack/hoptoad' | |
API_KEY = 'YOUR HOPTOAD API HERE' | |
class MyApp < Sinatra::Base # (was Sinatra::Default) | |
use Rack::Hoptoad, API_KEY | |
enable :raise_errors | |
set :show_exceptions, false | |
get "/" do | |
"Try raising an exception: <a href='/boom'>Boom</a>" | |
end | |
get "/boom" do | |
raise "Sinatra has left the building" | |
end | |
end | |
MyApp.run! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment