tiny-routes
tiny-routes copied to clipboard
Add a path-template matcher implementation to emulate Sinatra's splat parameters
Sinatra allows matching against splat or wildcard parameters.
Per their docs:
get '/say/*/to/*' do
# matches /say/hello/to/world
params['splat'] # => ["hello", "world"]
end
get '/download/*.*' do
# matches /download/path/to/file.xml
params['splat'] # => ["path/to/file", "xml"]
end
It may be useful to write a path-template matcher implementation to emulate this behavior.