Sha256: 83f3d217780f7974a643fa35c0a853d41c15b7c492c5afe2bd294ada0e0d1173

Contents?: true

Size: 890 Bytes

Versions: 1

Compression:

Stored size: 890 Bytes

Contents

require "sinatra/base"
require 'sinatra/json'
require 'json'

# Take over Sinatra's NotFound so we don't have to deal with the
# not_found block and can raise our own NotFound error
::Sinatra.send(:remove_const, :NotFound)
::Sinatra.const_set(:NotFound, ::Jersey::HTTP::Errors::NotFound)

module Jersey::API
  class Base < Sinatra::Base
    include Jersey::HTTP::Errors

    register Jersey::Extensions::RouteSignature

    use Rack::Deflater
    use Rack::ConditionalGet
    use Rack::ETag

    use Jersey::Middleware::RequestID
    use Jersey::Middleware::RequestLogger
    use Jersey::Middleware::ErrorHandler
    use Jersey::Middleware::AutoJson

    helpers Sinatra::JSON
    helpers Jersey::Helpers::Log
    helpers Jersey::Helpers::Success
    helpers Jersey::Helpers::AutoJsonParams

    set :dump_errors, false
    set :raise_errors, true
    set :show_exceptions, false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jersey-0.2.0 lib/jersey/base.rb