Sha256: ec523d6d85dc0efb3039c2a4744fdee0dfb696744d9531c43511eac0fbdd057d

Contents?: true

Size: 250 Bytes

Versions: 2

Compression:

Stored size: 250 Bytes

Contents

class API::V1 < API::Base
  version 'v1'
  format  :json

  rescue_from MyLib::BadRequest do |e|
    error!({ error: e }, 400)
  end

  get '/ok' do
    { status: 'OK' }
  end

  get '/failing' do
    raise MyLib::BadRequest, 'bad request'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grape-app-0.6.3 spec/scenario/app/api/v1.rb
grape-app-0.6.2 spec/scenario/app/api/v1.rb