forked from libremente/Portale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ru
41 lines (30 loc) · 870 Bytes
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ENV['LANG'] = 'it_IT.UTF-8'
$:.push('/usr/local/lib/spider/lib')
require 'spiderfw/init'
require 'spiderfw/http/adapters/rack'
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do
Spider.startup
end
end
use Rack::Session::Cookie, :expire_after => 2592000,
:secret => Spider.conf.get("rack_session_cookie.secret")
#configurazione per twitter
use OmniAuth::Builder do
provider :twitter, Spider.conf.get("twitter.client"), Spider.conf.get("twitter.secret")
end
# fine configurazione per twitter
require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '*',
headers: :any,
methods: [:get, :post, :put, :patch, :delete, :options, :head]
end
end
rack_app = Spider::HTTP::RackApplication.new
app = proc do |env|
rack_app.call(env)
end
run app