http://hapijs.com/tutorials/routing
I don't see examples here for optional tokens.
While I see examples such as: "/home/token/{value?}"
I do not see a way to do: "/home/optionalToken/{optionalValue?}/optionalOtherToken/{optionalOtherValue?}"
Is there a way to go about declaring optional parts of the path in more complicated patterns?
Specifically, I would like to be able to declare: "/{contentType}/page/{pageNumber?}/limit/{limitNumber?}"
where page
, pageNumber
, limit
, limitNumber
are all optional parts of the path.
The hapi documentation has this snippet of text, which indicates that it is not possible:
However, you might be able to achieve the same end result by registering the same route multiple times with differing paths. Example: