Skip to content

Instantly share code, notes, and snippets.

@tiagopog
Last active October 17, 2015 16:39
Show Gist options
  • Save tiagopog/ac20043ba85239d14a13 to your computer and use it in GitHub Desktop.
Save tiagopog/ac20043ba85239d14a13 to your computer and use it in GitHub Desktop.
Simple Rails' Rack example.
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
class MyMiddleware
def initialize(app)
@app = app
end
def call(env)
puts 'foobar'
@app.call(env)
end
end
# rackup config.ru
use MyMiddleware
run Rails.application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment