Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
The way I was FINALLY able to get Noah working on CF
require 'sinatra'
require 'rack'
require 'thin'
require 'noah'
require 'ohm'
vcap_services = JSON.load(ENV['VCAP_SERVICES'])
redis_host = vcap_services["redis-2.2"][0]["credentials"]["hostname"]
redis_port = vcap_services["redis-2.2"][0]["credentials"]["port"]
redis_password = vcap_services["redis-2.2"][0]["credentials"]["password"]
app_ip = vcap_services['VMC_APP_HOST']
app_port = vcap_services['VMC_APP_PORT']
Ohm.connect(:host => redis_host, :port => redis_port, :password => redis_password)
server = ::Rack::Server.new()
server.instance_variable_set('@config', 'config.ru' )
server.start
require 'rubygems'
require 'thin'
require 'noah'
vcap_services = JSON.load(ENV['VCAP_SERVICES'])
redis_host = vcap_services["redis-2.2"][0]["credentials"]["hostname"]
redis_port = vcap_services["redis-2.2"][0]["credentials"]["port"]
redis_password = vcap_services["redis-2.2"][0]["credentials"]["password"]
app_ip = vcap_services['VMC_APP_HOST']
app_port = vcap_services['VMC_APP_PORT']
ENV['REDIS_URL'] = "redis://#{redis_host}:#{redis_port}/0"
noah = Noah::App.new do
set :run, false
end
run noah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment