Permalink
Browse files

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

… endpoint.
  • Loading branch information...
1 parent 3ee82c3 commit 69fe776c5f48db4cbc7c5af5b21812020d41212e @czarneckid committed Jun 13, 2012
Showing with 10 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +6 −0 api.rb
  3. +3 −0 config.ru
View
@@ -1,6 +1,7 @@
source :rubygems
gem 'grape'
+gem 'redis'
platforms :ruby do
gem 'unicorn'
View
@@ -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
@@ -1,5 +1,8 @@
$LOAD_PATH << '.'
require 'api'
+require 'redis'
+
+$redis = Redis.new
run PumaBenchmark::API

0 comments on commit 69fe776

Please sign in to comment.