Created
June 18, 2018 14:55
Middleware to print to the screen so I can see the responses when streaming data
This file contains 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
# app/config/environments/development.rb | |
# Middleware to print to the screen so I can see the responses when streaming data | |
config.middleware.use( | |
Class.new do | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
status, headers, response = @app.call(env) | |
response.each do |r| | |
puts "########### REQUEST ##########\n" | |
end | |
[status, headers, response] | |
end | |
end | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment