HTTP adapter for use with the Flipper Api.
Given you have mounted the Flipper Api on an application, you can use the HTTP adapter to interact with Flipper just like any other adapter, and internally it will handle all the http requests for you. This means that you can have the application exposing the API store your Flipper data, but interact with it from other Ruby apps.
Initialize the HTTP adapter with a configuration Hash.
require 'flipper/adapters/http'
Flipper.configure do |config|
config.adapter do
Flipper::Adapters::Http.new({
url: 'http://app.com/mount-point', # required
headers: { 'X-Custom-Header' => 'foo' },
basic_auth_username: 'user123',
basic_auth_password: 'password123'
read_timeout: 5,
open_timeout: 2,
})
end
end
Required keys:
Optional keys:
These will affect every request the adapter makes. For example, send basic auth credentials with every request.
debug_output: $stderr
). The output stream is passed on to Net::HTTP#set_debug_output.