aboutsummaryrefslogtreecommitdiffstats
path: root/config.ru
diff options
context:
space:
mode:
Diffstat (limited to 'config.ru')
-rw-r--r--config.ru15
1 files changed, 12 insertions, 3 deletions
diff --git a/config.ru b/config.ru
index 238f43f..e3112a6 100644
--- a/config.ru
+++ b/config.ru
@@ -1,9 +1,18 @@
# Start home_timeline polling
require_relative "service"
-Service.setup
-
-# Start web app
require_relative "app"
+# HACK: The web app must be already started and accept "GET /webhook" when
+# Service.setup is called
+Thread.start {
+ sleep 1
+ begin
+ Net::HTTP.get_response(URI(ENV["TWITTER_EVENT_STREAM_BASE_URL"]))
+ rescue
+ end
+ Service.setup
+}
+
+# Start web app
use Rack::Deflater
run App