有沒有辦法使用地圖和(蓮花)路由器命名空間在一起?下面是一個示例config.ru
我試圖讓它作爲演示運行。如何使用蓮花路由器與機架::生成器::地圖
require 'bundler'
Bundler.require
module Demo
class Application
def initialize
@app = Rack::Builder.new do
map '/this_works' do
run Proc.new {|env| [200, {"Content-Type" => "text/html"}, ["this_works"]]}
end
map '/api' do
run Lotus::Router.new do
get '/api/', to: ->(env) { [200, {}, ['Welcome to Lotus::Router!']] }
get '/*', to: ->(env) { [200, {}, ["This is catch all: #{ env['router.params'].inspect }!"]] }
end
end
end
end
def call(env)
@app.call(env)
end
end
end
run Demo::Application.new
upvoted讓你到你的1500點儘快:) – Rahul
@Rahul thx,我通知項目業主,他們得到了標籤添加https://github.com/lotus/router/issues/5 – Krut