Sha256: 4b5db0e1e7dd07da7edc7b6dc059dd6ccd628553729b8159622565605129d3bd

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

# frozen_string_literal: true

require 'sinatra'

class Application < Sinatra::Base
  before do
    content_type 'application/json'
  end

  get '/status' do
    status 208
    return { name: 'Sample App', version: '0.0.1', status: 'OK' }.to_json
  end

  get '/embeded_status' do
    status 208
    return { code: 208, data: { name: 'Sample App', version: '0.0.1', status: 'OK' } }.to_json
  end

  get '/collection' do
    return [{ one: 1 }, { two: 2 }, { three: 3 }].to_json
  end

  get '/embeded_collection' do
    return { code: 200, data: [{ one: 1 }, { two: 2 }, { three: 3 }] }.to_json
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-rest-rspec-1.0.0 samples/app.rb