Class: Tinycms::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/tinycms/client.rb

Constant Summary collapse

BASE_URL =
"https://www.tinycms.app"

Instance Method Summary collapse

Instance Method Details

#clientObject



9
10
11
12
13
14
15
16
17
# File 'lib/tinycms/client.rb', line 9

def client
  @client ||= Faraday.new(
    url: BASE_URL,
    headers: { "Content-Type": "application/json", "API-Key": Tinycms.config.api_key }
  ) do |conn|
    conn.request :json
    conn.response :json
  end
end