-
-
Save johnl/7efffc8429f4c0ad0803f087a85b5f68 to your computer and use it in GitHub Desktop.
A simple rack middleware to debug the request pipeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage example | |
require "inspect_env" | |
use InspectEnv | |
run GenericSinatraApp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InspectEnv | |
require "yaml" | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
print_env_class = lambda do |klass| | |
puts env.inspect | |
end | |
print_env_class.call(@app) | |
@app.call(env) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment