about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-04 00:34:31 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-04 00:34:31 +0100
commitccb8ac857330e1ad3aee37b340e5c6e242ac1dd6 (patch)
tree38c2bd062cd619f12d31836a1dc4ad2e2f70468d /config/initializers
parent8c0bc1309fd40807cf5895b492fc7d1a2c9d7b83 (diff)
Make the streaming API also handle websockets (because trying to get the browser EventSource interface to
work flawlessly was a nightmare). WARNING: This commit makes the web UI connect to the streaming API instead
of ActionCable like before. This means that if you are upgrading, you should set that up beforehand.
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/ostatus.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/initializers/ostatus.rb b/config/initializers/ostatus.rb
index faa9940b0..fb0b8b7fe 100644
--- a/config/initializers/ostatus.rb
+++ b/config/initializers/ostatus.rb
@@ -10,8 +10,10 @@ Rails.application.configure do
   config.x.use_s3       = ENV['S3_ENABLED'] == 'true'
 
   config.action_mailer.default_url_options = { host: host, protocol: https ? 'https://' : 'http://', trailing_slash: false }
+  config.x.streaming_api_base_url          = 'http://localhost:4000'
 
   if Rails.env.production?
     config.action_cable.allowed_request_origins = ["http#{https ? 's' : ''}://#{host}"]
+    config.x.streaming_api_base_url             = ENV.fetch('STREAMING_API_BASE_URL') { "http#{https ? 's' : ''}://#{host}" }
   end
 end