Ged
Ged

Reputation: 110

Splat equivalent in Nancy

I'm trying to match all routes in a Nancy module. Sinatra uses splat parameters, e.g

get '/download/*.*' do
  # matches /download/path/to/file.xml
  params[:splat] # => ["path/to/file", "xml"]
end

Does this exist in Nancy?

Upvotes: 1

Views: 336

Answers (1)

Steven Robbins
Steven Robbins

Reputation: 26599

This is covered in the docs - have a look at the greedy node:

https://github.com/NancyFx/Nancy/wiki/Defining-routes

Upvotes: 3

Related Questions