Sha256: 9c8357239a5dfe8fc6034456712d10e3bbc02ee98ca206f3da8a05fc988d1f26
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
require 'attune/param_flattener' require "attune/call_dropping" require "attune/json_logger" require "attune/net_http_persistent" module Attune # Default options module Default extend Configurable ENDPOINT = "http://localhost/".freeze # user our version of NetHttpPersistent adapter Faraday::Adapter.register_middleware(attune_http_persistent: NetHttpPersistent) MIDDLEWARE = Faraday::Builder.new do |builder| # Needed for encoding of BATCH GET requests builder.use Attune::ParamFlattener # Log all requests builder.use Attune::CallDropping builder.request :url_encoded # Allow one retry per request builder.request :retry, 1 # Log all requests builder.use Attune::JsonLogger # Raise exceptions for HTTP 4xx/5xx builder.response :raise_error builder.adapter :attune_http_persistent end configure do |c| c.endpoint = ENDPOINT c.middleware = MIDDLEWARE c.disabled = false c.exception_handler = :raise c.timeout = 1 end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
attune-1.0.5 | lib/attune/default.rb |