No commit activity in last 3 years
No release in over 3 years
Provides the ability to inspect your backend Faraday requests via a web UI.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 10.0
~> 3.3
>= 0

Runtime

 Project Readme

Rack::FaradayInspector

Code Climate

Rack::FaradayInspector renders a bit of HTML at the bottom of your pages that allows you to inspect all of the HTTP requests Faraday made during the current Rails action.

It's like your browser's developer tools network view, but for your backend API requests.

rack-faraday_inspector

Currently only supports Rails and requires jQuery.

Installation

Add this line to your application's Gemfile:

gem 'rack-faraday_inspector', github: 'chrisb/rack-faraday_inspector'

I'm still actively working on this Gem, so pull from GitHub.

Usage

In order to instrument and show Faraday requests, you'll need to add the middleware to your connection:

Faraday.new url: 'http://www.sushi.com' do |faraday|
  faraday.use :inspector
  # ...
end

By default the inspector web UI is disabled. To enable the inspector, add the following to an initializer, or better yet, to the specific Rails environment configurations that you want to enable the inspector for:

i.e. in config/environments/development.rb:

Rails.application.configure do
  # ...
  Rack::FaradayInspector.enabled = true
end

Or in something like config/initializers/faraday_inspector.rb:

Rack::FaradayInspector.enabled = Rails.env.development?

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/chrisb/rack-faraday_inspector.