diff --git a/app/models/neopets_user.rb b/app/models/neopets_user.rb index 0746d607..72649baf 100644 --- a/app/models/neopets_user.rb +++ b/app/models/neopets_user.rb @@ -5,7 +5,8 @@ class NeopetsUser include ActiveModel::Conversion extend ActiveModel::Naming - GATEWAY_URL = 'http://www.neopets.com/amfphp/gateway.php' + NEOPETS_URL_ORIGIN = ENV['NEOPETS_URL_ORIGIN'] || 'http://www.neopets.com' + GATEWAY_URL = NEOPETS_URL_ORIGIN + '/amfphp/gateway.php' GET_PETS_METHOD = RocketAMF::RemoteGateway.new(GATEWAY_URL). service('MobileService').action('getPets') diff --git a/app/models/pet.rb b/app/models/pet.rb index d7aa704d..ead93f95 100644 --- a/app/models/pet.rb +++ b/app/models/pet.rb @@ -2,7 +2,8 @@ require 'rocketamf/remote_gateway' require 'ostruct' class Pet < ActiveRecord::Base - GATEWAY_URL = 'http://www.neopets.com/amfphp/gateway.php' + NEOPETS_URL_ORIGIN = ENV['NEOPETS_URL_ORIGIN'] || 'http://www.neopets.com' + GATEWAY_URL = NEOPETS_URL_ORIGIN + '/amfphp/gateway.php' PET_VIEWER = RocketAMF::RemoteGateway.new(GATEWAY_URL). service('CustomPetService').action('getViewerData') PET_NOT_FOUND_REMOTE_ERROR = 'PHP: Unable to retrieve records from the database.'