Sha256: 1450f67b3c19b30b03148a11a4ac8ad00de527c712f908b4ec3f9e368aa7bcf4

Contents?: true

Size: 1.77 KB

Versions: 5

Compression:

Stored size: 1.77 KB

Contents

#!/usr/bin/env ruby

path = File.join(File.dirname(__FILE__),'..','..','lib')
$:.unshift path

# Try to load vendor-ed rhoconnect, otherwise load the gem
begin
  require 'vendor/rhoconnect/lib/rhoconnect/server'
  require 'vendor/rhoconnect/lib/rhoconnect/console/server'
rescue LoadError
  require 'rhoconnect/server'
  require 'rhoconnect/console/server'
end

require 'x_domain_session_wrapper'
use XDomainSessionWrapper

# By default, turn on the resque web console
require 'resque/server'

ROOT_PATH = File.expand_path(File.dirname(__FILE__))

# Rhoconnect server flags
Rhoconnect::Server.disable :run
Rhoconnect::Server.disable :clean_trace
Rhoconnect::Server.enable  :raise_errors
Rhoconnect::Server.set     :root,        ROOT_PATH
Rhoconnect::Server.enable  :stats
Rhoconnect::Server.set     :secret, '3ddaa72a36466bae3fc5e54c09324db50cfc30588d8dee1a2700e61195bdbbb5eeb65da2a184d274ce644b20b0e986046c2447730c85555ce18a4eb2fce7ebf5'
Rhoconnect::Server.use     Rack::Static, :urls => ["/data"], :root => Rhoconnect::Server.root
                     
# configure Cross-Domain Resource Sharing
require 'cors'
use Rack::Cors do |cfg|
  cfg.allow do |allow|
    allow.origins /.*/
    allow.resource '/application',   :headers => :any, :methods => [:get, :post, :put, :delete], :credentials => true
    allow.resource '/application/*', :headers => :any, :methods => [:get, :post, :put, :delete], :credentials => true
  end
end                     
                           
# Load our rhoconnect application
require './application'

# Setup the url map
run Rack::URLMap.new \
	"/"         => Rhoconnect::Server.new,
	"/resque"   => Resque::Server.new, # If you don't want resque frontend, disable it here
	"/console"  => RhoconnectConsole::Server.new # If you don't want rhoconnect frontend, disable it here

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rhoconnect-3.0.1 examples/simple/config.ru
rhoconnect-3.0.0 examples/simple/config.ru
rhoconnect-3.0.0.rc1 examples/simple/config.ru
rhoconnect-3.0.0.beta3 examples/simple/config.ru
rhoconnect-3.0.0.beta1 examples/simple/config.ru