Sha256: c6cedd619d4aac247cb6e3dfe2a58e29a07797eab9f6ca1f792660bc0753907d

Contents?: true

Size: 281 Bytes

Versions: 5

Compression:

Stored size: 281 Bytes

Contents

class API::V1 < Grape::API::Instance
  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

  mount API::Posts
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
grape-app-0.8.3 spec/scenario/app/api/v1.rb
grape-app-0.8.2 spec/scenario/app/api/v1.rb
grape-app-0.8.1 spec/scenario/app/api/v1.rb
grape-app-0.8.0 spec/scenario/app/api/v1.rb
grape-app-0.7.1 spec/scenario/app/api/v1.rb