Skip to content

Commit

Permalink
Merge pull request #980 from alphagov/switch-the-worldwide-api-endpoint
Browse files Browse the repository at this point in the history
Switch the Worldwide API endpoint
  • Loading branch information
Christopher Baines authored Jan 16, 2020
2 parents 6f044f6 + 6bcd8d4 commit 8ee0495
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 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
9 changes: 5 additions & 4 deletions lib/gds_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ def self.maslow(options = {})
GdsApi::Maslow.new(Plek.new.external_url_for("maslow"), options)
end

# Creates a GdsApi::Organisations adapter for accessing Whitehall APIs on a
# whitehall-admin host
# Creates a GdsApi::Organisations adapter for accessing Whitehall
# APIs through the origin, where the requests will be handled by
# Collections frontend.
#
# @return [GdsApi::Organisations]
def self.organisations(options = {})
Expand Down Expand Up @@ -192,10 +193,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 8ee0495

Please sign in to comment.