The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
479 B

  1. # frozen_string_literal: true
  2. class Api::V1::StreamingController < Api::BaseController
  3. respond_to :json
  4. def index
  5. if Rails.configuration.x.streaming_api_base_url != request.host
  6. redirect_to streaming_api_url, status: 301
  7. else
  8. not_found
  9. end
  10. end
  11. private
  12. def streaming_api_url
  13. Addressable::URI.parse(request.url).tap do |uri|
  14. uri.host = Addressable::URI.parse(Rails.configuration.x.streaming_api_base_url).host
  15. end.to_s
  16. end
  17. end