Class: Bigcommerce::Config

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/bigcommerce/config.rb

Constant Summary collapse

DEFAULTS =
{
  base_url: 'https://api.bigcommerce.com'
}.freeze

Instance Method Summary collapse

Instance Method Details

#api_urlObject


7
8
9
10
11
12
# File 'lib/bigcommerce/config.rb', line 7

def api_url
  return url if auth == 'legacy'

  base = ENV['BC_API_ENDPOINT'].to_s.empty? ? DEFAULTS[:base_url] : ENV['BC_API_ENDPOINT']
  "#{base}/stores/#{store_hash}/v2"
end