Skip to content

Commit

Permalink
Switch the Worldwide requests to go to whitehall-frontend
Browse files Browse the repository at this point in the history
The whitehall-frontend and whitehall-admin hosts should provide
identical responses, as they're the same code. The whitehall-frontend
hosts are setup for handling frontend requests, and have a read-only
database connection. The whitehall-admin hosts are setup for handling
the admin interface.

As the Worldwide API doesn't do any writing, it's suitable to be
handled by the whitehall-frontend hosts. This change is motivated by
the migration to AWS, as it'll be easier to keep whitehall-frontend up
during the migration (compared to whitehall-admin).
  • Loading branch information
Christopher Baines committed Jan 16, 2020
1 parent 6f044f6 commit 61096ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Unreleased

* Change Worldwide API requests to be routed to whitehall-frontend by
default, rather than whitehall-admin. Update the test helpers
accordingly.

# 63.2.0

* Issue a warning when deprecated stub methods are called. `stub_*` methods
Expand Down
4 changes: 2 additions & 2 deletions lib/gds_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def self.support_api(options = {})
end

# Creates a GdsApi::Worldwide adapter for accessing Whitehall APIs on a
# whitehall-admin host
# whitehall-frontend host
#
# @return [GdsApi::Worldwide]
def self.worldwide(options = {})
GdsApi::Worldwide.new(Plek.find("whitehall-admin"), options)
GdsApi::Worldwide.new(Plek.find("whitehall-frontend"), options)
end
end
2 changes: 1 addition & 1 deletion lib/gds_api/test_helpers/worldwide.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Worldwide
extend AliasDeprecated
include GdsApi::TestHelpers::CommonResponses

WORLDWIDE_API_ENDPOINT = Plek.current.find("whitehall-admin")
WORLDWIDE_API_ENDPOINT = Plek.current.find("whitehall-frontend")

# Sets up the index endpoints for the given country slugs
# The stubs are setup to paginate in chunks of 20
Expand Down

0 comments on commit 61096ed

Please sign in to comment.