-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ru
More file actions
35 lines (28 loc) · 782 Bytes
/
config.ru
File metadata and controls
35 lines (28 loc) · 782 Bytes
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
# encoding: utf-8
LIB = File.dirname(__FILE__) + '/lib'
$LOAD_PATH.unshift LIB unless $LOAD_PATH.include?(LIB)
require 'active_record'
require 'convertlabsdk'
require 'convertlabsdk/server'
require 'resque'
require 'resque/server'
require 'sinatra/base'
use Rack::ShowExceptions
Resque.redis = ENV['REDIS_HOST'] || 'localhost:6379'
ConvertLab.database_yml = 'config/database.yml'
ConvertLab.establish_connection
# insert tab into Resque web console to navigate to syncer
module Resque
Resque::Server.tabs
class Server < Sinatra::Base
get '/syncer' do
redirect "#{url_prefix}/../syncer"
end
end
end
Resque::Server.tabs << 'Syncer'
# end of hacking Resque web
run Rack::URLMap.new(
'/syncer' => ConvertLab::Server.new,
'/resque' => Resque::Server.new
)