Skip to content

Instantly share code, notes, and snippets.

@TomV
Created March 11, 2010 01:49
Show Gist options
  • Save TomV/328707 to your computer and use it in GitHub Desktop.
Save TomV/328707 to your computer and use it in GitHub Desktop.
# 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