Skip to content

Instantly share code, notes, and snippets.

@johnmeehan
Created June 18, 2018 14:55
Show Gist options
  • Save johnmeehan/59d1d1ff88bee5846900430d133a4a97 to your computer and use it in GitHub Desktop.
Save johnmeehan/59d1d1ff88bee5846900430d133a4a97 to your computer and use it in GitHub Desktop.
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