Module: Tacokit::Middleware

Defined in:
lib/tacokit/middleware.rb,
lib/tacokit/middleware/raise_error.rb

Defined Under Namespace

Classes: RaiseError

Class Method Summary collapse

Class Method Details

.default_stack(config = Tacokit.configuration) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/tacokit/middleware.rb', line 9

def default_stack(config = Tacokit.configuration)
  proc do |http|
    http.request :json
    http.request :multipart
    http.request :url_encoded

    http.response :json, content_type: /\bjson$/
    http.response :raise_error
    http.response :logger if ENV["DEBUG"]

    http.adapter Faraday.default_adapter
  end
end