Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
post '/interests' do
# Connect to Redis
uri = URI.parse(ENV["REDIS_URL"] || 'redis://localhost:6379')
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
# Parse the JSON body
join = JSON.parse(request.body.read)
# Register the user's interest in an artist
REDIS.sadd("artists:#{join['artist_id']}", join['user_id'])
REDIS.sadd("users:#{join['user_id']}", join['artist_id'])
status 201
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.