Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 591 Bytes

hanami_router_integration.md

File metadata and controls

27 lines (20 loc) · 591 Bytes

hanami-router integration

A web_pipe application instance is a rack application. Consequently, you can mount it with hanami-router's' to: option.

# config.ru
require 'hanami/router'
require 'web_pipe'

class MyApp
  include WebPipe
  
  plug :this, ->(conn) { conn.set_response_body('This') }
end

router = Hanami::Router.new do
  get 'my_app', to: MyApp.new
end

run router

To perform string matching with variables you just need to load :router_params extension.