Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added redis gem. Do more work and call out to service in redis/getset…

… endpoint.
  • Loading branch information...
commit 69fe776c5f48db4cbc7c5af5b21812020d41212e 1 parent 3ee82c3
@czarneckid authored
Showing with 10 additions and 0 deletions.
  1. +1 −0  Gemfile
  2. +6 −0 api.rb
  3. +3 −0  config.ru
View
1  Gemfile
@@ -1,6 +1,7 @@
source :rubygems
gem 'grape'
+gem 'redis'
platforms :ruby do
gem 'unicorn'
View
6 api.rb
@@ -16,5 +16,11 @@ class API < Grape::API
{:status => 'ok', :data => SecureRandom.hex}
end
end
+
+ resource :redis do
+ get '/getset' do
+ {:status => 'ok', :data => $redis.getset('data_key', SecureRandom.hex)}
+ end
+ end
end
end
View
3  config.ru
@@ -1,5 +1,8 @@
$LOAD_PATH << '.'
require 'api'
+require 'redis'
+
+$redis = Redis.new
run PumaBenchmark::API
Please sign in to comment.
Something went wrong with that request. Please try again.