Skip to content

Support for flexible routes #3

@avaly

Description

@avaly

Disclaimer: this is a duplicate post for hapijs/hapi#2058

According to http://hapijs.com/api#path-parameters and the actual implementation of routes in v7+, one can not register the following route: /{foo}-custom-string-{bar}, due to the restriction that a path segment can not contain more than one parameter.

This should be changed and it should allow the creation of more flexible routes. Not all users of hapi use it to create only API sites, some of us use it to run a user facing site where SEO and the public URL structure is important.

I know we can do this by using a single parameter for the whole segment and then parsing that parameter inside the handler method, but that ruins the whole idea of using a framework that handles these small things for you.

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions