Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike - Add demo of different content on different domains #1156

Merged
merged 1 commit into from Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/controllers/ctc_pages_controller.rb
@@ -0,0 +1,5 @@
class CtcPagesController < ApplicationController
def root
render html: "Welcome to a CTC-only page"
end
end
9 changes: 9 additions & 0 deletions app/lib/routes/ctc_domain.rb
@@ -0,0 +1,9 @@
module Routes
class CtcDomain
def matches?(request)
app_base_domains = ["localhost", "getyourrefund.org", "staging.getyourrefund.org", "demo.getyourrefund.org"]
ctc_hosts = app_base_domains.map { |domain| ["ctc.#{domain}", "www.ctc.#{domain}"] }.flatten
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the ctc domains should work fine out of the box in demo and staging? Should we attempt to push this to staging to validate that?

ctc_hosts.include?(request.host)
end
end
end
9 changes: 9 additions & 0 deletions app/lib/routes/gyr_domain.rb
@@ -0,0 +1,9 @@
module Routes
class GyrDomain
def matches?(request)
app_base_domains = ["localhost", "getyourrefund.org", "staging.getyourrefund.org", "demo.getyourrefund.org"]
ctc_hosts = app_base_domains.map { |domain| ["ctc.#{domain}", "www.ctc.#{domain}"] }.flatten
!ctc_hosts.include?(request.host)
end
end
end