Created
October 13, 2021 13:41
-
-
Save ignacio-chiazzo/13bbae47dda3134e9816b4abeb6da1b6 to your computer and use it in GitHub Desktop.
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
module Middleware | |
class BasicMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
# Before the app is called. | |
status, headers, response = @app.call(env) | |
# After the app is called. | |
[status, headers, response] # It always needs to respond with [status, header, response]. | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment