Skip to content

Instantly share code, notes, and snippets.

@chrisallick
Created September 25, 2018 18:04
Show Gist options
  • Save chrisallick/0b281435aec51aacb09ab67331e7f347 to your computer and use it in GitHub Desktop.
Save chrisallick/0b281435aec51aacb09ab67331e7f347 to your computer and use it in GitHub Desktop.
require 'base64'
require 'openssl'
require 'sinatra'
require 'sinatra/partial'
require 'sinatra/reloader' if development?
require 'resque'
require './email_sender'
configure do
redisUri = ENV["REDISTOGO_URL"] || 'redis://localhost:6379'
uri = URI.parse(redisUri)
$redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
$redis.set("test", "dope") # works
$redis.get("test", "dope") # works
# $redis is available anywhere in app.rb
end
$redis.get("test", "dope") # works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment