Sha256: 0d6775e6415a2bdc54ceccf2be3fa2ba9b4cf1385b4b5f44653fc77a5f7940b3

Contents?: true

Size: 694 Bytes

Versions: 7

Compression:

Stored size: 694 Bytes

Contents


usecase "Set" do
  set :key    => :simple
  set :token    => '1901484c41b8752d61863e323c743abe2c6e90f8841bbdfa789e1d70bc6f4899'
  
  get "/v1/set/:key" do
    set :value => (rand*100000).to_i
    param :token    => resource(:token)
    param :value  => resource(:value)
  end
  
  get "/v1/get/:key" do
    param :token    => resource(:token)
    response 200 do
      p [resource(:value), body.to_i]
    end
  end
  
  get "/v1/set/:key" do
    param :key => rand(1000).to_i
    set :value => (rand*100000).to_i
    param :token    => resource(:token)
    param :value  => resource(:value)
  end
  
  xpost "/v1/set/:key" do
    param :key    => :file
    body file('/tmp/file')
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
boned-0.2.6 api/api-set.rb
boned-0.2.5 api/api-set.rb
boned-0.2.4 api/api-set.rb
boned-0.2.3 api/api-set.rb
boned-0.2.2 api/api-set.rb
boned-0.2.1 api/api-set.rb
boned-0.2.0 config/stella/api-set.rb