From 029c7e0027525106ef010c909af870f4b81d6f69 Mon Sep 17 00:00:00 2001 From: Albert Vernon Date: Wed, 31 May 2017 23:31:18 -0400 Subject: [PATCH] Complain if API_KEY or API_SECRET is not set --- 01 Getting Started/app.rb | 3 +++ 02 Charging For Your App/app.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/01 Getting Started/app.rb b/01 Getting Started/app.rb index b37c5e6..392604b 100644 --- a/01 Getting Started/app.rb +++ b/01 Getting Started/app.rb @@ -10,6 +10,9 @@ class GiftBasket < Sinatra::Base API_SECRET = ENV['API_SECRET'] APP_URL = "jamie.ngrok.io" + fail 'API_KEY environment variable is not set' if API_KEY.blank? + fail 'API_SECRET environment variable is not set' if API_SECRET.blank? + def initialize @tokens = {} super diff --git a/02 Charging For Your App/app.rb b/02 Charging For Your App/app.rb index c6fa6f5..73aa860 100644 --- a/02 Charging For Your App/app.rb +++ b/02 Charging For Your App/app.rb @@ -10,6 +10,9 @@ class GiftBasket < Sinatra::Base API_SECRET = ENV['API_SECRET'] APP_URL = "jamie.ngrok.io" + fail 'API_KEY environment variable is not set' if API_KEY.blank? + fail 'API_SECRET environment variable is not set' if API_SECRET.blank? + def initialize @tokens = {} super