In OpenRasta, how do I configure a URI where I get "the remainder of the path" as a single string?
- by Daniel Earwicker
Normally in OpenRasta there is some configuration like this:
ResourceSpace.Has.ResourcesOfType<Customers>()
.AtUri("/customers/region/{region}")
... // and so on
... where the {region} part of the path is automatically mapped to a string parameter in the handling method. So if the user hits:
http://server/customers/region/emea
Then the handler method is passed the string "emea".
As well as doing this, I'd like to register a handler with something like this:
ResourceSpace.Has.ResourcesOfType<Customers>()
.AtUri("/someotherthing/*")
... // and so on
In this imaginary syntax, the asterisk would mean "take the rest of the path, including slashes, to be a single string parameter to pass to the handling method". And so if the user hits:
http://server/someotherthing/how/about/this?that=other
Then my handler method receives a string parameter:
how/about/this?that=other
Is such a thing possible in OpenRasta?
In Sinatra (Ruby) I'd use a regular expression to do exactly this.