Last active
May 20, 2020 17:17
-
-
Save anasbgoncalves/133063ec994238f7a8fc6e0eddfd667f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faraday' | |
require 'json' | |
class Connection | |
BASE = 'https://spoonacular-recipe-food-nutrition-v1.p.mashape.com' | |
def self.api | |
Faraday.new(url: BASE) do |faraday| | |
faraday.response :logger | |
faraday.adapter Faraday.default_adapter | |
faraday.headers['Content-Type'] = 'application/json' | |
faraday.headers['X-Mashape-Key'] = ENV['MASHAPE_KEY'] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment