Rack Middleware Configure Rack middleware stack for your Hanami project

Rack Middleware

Hanami exposes a project level Rack middleware stack to be configured like this:

# config/environment.rb

Hanami.configure do
  # ...
  middleware.use MyRackMiddleware
end

It’s worth noticing that this is equivalent to add a middleware in config.ru file. The only difference is that third-party plugins can hook into Hanami.configure to inject their own middleware.

Read more at https://guides.hanamirb.org/projects/rack-middleware/

Twitter Facebook

Want to learn more about Hanami?

We have written an extensive Getting Started guide for curious people like you.