Skip to content

Instantly share code, notes, and snippets.

@johnmeehan
Created June 18, 2018 14:55
Middleware to print to the screen so I can see the responses when streaming data
# 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