Method: Hanami::Config#middleware

Defined in:
lib/hanami/config.rb

#middlewareHanami::Slice::Routing::Middleware::Stack? (readonly) Also known as: middleware_stack

Returns the app’s middleware stack, or nil if hanami-router is not bundled.

Use this to configure middleware that should apply to all routes.

Examples:

config.middleware.use :body_parser, :json
config.middleware.use MyCustomMiddleware

Returns:

Since:

  • 2.0.0

[View source]

250
251
252
# File 'lib/hanami/config.rb', line 250

def middleware
  @middleware
end