Skip to content

Instantly share code, notes, and snippets.

@cypher
Created February 28, 2011 13:19
Show Gist options
  • Save cypher/847302 to your computer and use it in GitHub Desktop.
Save cypher/847302 to your computer and use it in GitHub Desktop.
class MyAwesomeMiddleware
def initialize(app)
@app = app
end
def call(env)
return_value = @app.call(env)
do_awesome_post_request_processing
return_value
end
def do_awesome_post_request_processing
# ...
end
end
require 'my_awesome_middleware'
require 'sinatra'
require 'my_sinatra_app'
use MyAwesomeMiddleware
run Sinatra::Application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment