Sha256: a6fa374927e9f6fb4f4ae2b9276d20f4af9420f443940abf6673f8448ee8eff5

Contents?: true

Size: 899 Bytes

Versions: 1

Compression:

Stored size: 899 Bytes

Contents

module Quintype::Routes
  class Railtie < Rails::Railtie
    config.quintype_routes = ActiveSupport::OrderedOptions.new

    initializer "quintype-routes.register_routes" do |app|
      app.config.middleware.insert_before(Rack::Runtime, Rack::ReverseProxy) do
        api_host = app.config.quintype_routes.quintype_host

        raise "Please set config.quintype_routes.quintype_host" unless app.config.quintype_routes.quintype_host

        reverse_proxy '/api', api_host
        reverse_proxy '/login', api_host
        reverse_proxy '/auth.form', api_host
        reverse_proxy '/admin', api_host
        reverse_proxy '/shrubbery', api_host
        reverse_proxy '/sitemap', api_host
        reverse_proxy '/feed', api_host
        reverse_proxy '/rss-feed', api_host
        reverse_proxy '/stories.rss', api_host
        reverse_proxy '/news_sitemap.xml', api_host
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quintype-routes-0.1.0 lib/quintype/routes/railtie.rb