Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (18 sloc) 600 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

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

You can’t perform that action at this time.