Add support for using path-to-regexp in template.