Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Integrate `hanami-router` `v2.0.0.alpha2` #1032
That gem now has the concept of resolver that can be passed to
This is the role of the new class:
Hanami 2 will support multiple slices (formerly known as "apps") in the same app. When a developer will generate a new app with
The definition of the routes of each slice must be grouped by the
# config/routes.rb Hanami.application.routes do slice :main, at "/" do root to: "home#index" end slice :admin, at: "/admin" do get "/users", to: "users#index" end end
We can't use directly
There are two ways to add a Rack middleware to the application stack:
# config/application.rb module Soundeck class Application < Hanami::Application config.use MyGlobalRackMiddleware end end
In this case
This is important if third-party gems want to add their own Rack middleware to the application stack.
# config/routes.rb Hanami.application.routes do use ElapsedTimeMiddleware get "/login", to: "sessions#new" scope "api" do use APIAuthentication get "/", to: "api#index" end end
Rack Middleware in routes is hierarchical, similar to variable definitions. The outer the declaration, the broader the scope.
In this example,