ruby - Priority among route patterns -
i have thin
server running (without web application framework). in routing pattern, order of matching patterns not seem make difference. whether do:
rack::handler::thin.run(rack::builder.new map("/"){...} map("/foo/"){...} end, port: 3000)
or
rack::handler::thin.run(rack::builder.new map("/foo/"){...} map("/"){...} end, port: 3000)
the request localhost:3000/foo/
correctly picked map("/foo/"){...}
, not map("/"){...}
. how priority determined?
for web application frameworks, example in sinatra, says routes matched in order defined. first route matches request invoked
, not case setup have app.
https://github.com/rack/rack/blob/master/lib/rack/urlmap.rb
priority doesn't determined in rack::urlmap. matched full path of resource, provide with
map(){ ... }
Comments
Post a Comment