Created
May 27, 2010 14:03
-
-
Save adhusson/415830 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
require 'sinatra/base' | |
require 'pony' | |
require 'erubis' | |
require 'validatable' | |
Dir["lib/*.rb"].each {|file| require file } | |
class FermeGallard < Sinatra::Base | |
set :sessions, true | |
configure do | |
set :raise_errors, true | |
set :env, :production | |
# Disable Sinatra's built-in webserver | |
disable :run | |
# Serves static content from the public folder. | |
enable :static | |
set :views, Pathname.new(__FILE__).dirname.join('views').expand_path | |
set :public, Pathname.new(__FILE__).dirname.join('public').expand_path | |
set :haml, {:format => :html4} | |
end | |
helpers Sinatra::Partials, Helpers | |
get '/' do | |
haml :accueil | |
end | |
# ... | |
get '/error' do | |
fail "TEST FAILING" # This shows an error in the browser but Exceptional receives nothing. | |
end | |
end |
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
begin | |
# Require the preresolved locked set of gems. | |
require ::File.expand_path('../.bundle/environment', __FILE__) | |
rescue LoadError | |
# Fallback on doing the resolve at runtime. | |
require "rubygems" | |
require "bundler" | |
Bundler.setup | |
end | |
require 'exceptional' | |
require 'application' | |
use Rack::Exceptional, "API_KEY" | |
run FermeGallard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment