Created
September 25, 2018 18:04
-
-
Save chrisallick/0b281435aec51aacb09ab67331e7f347 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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