Support passing options to `url-pattern`
kevva opened this issue · comments
Kevin Mårtensson commented
I have a use case where I want to match everything after a certain path, but micro-router
only lets me match certain characters, so instead I have to use a regex like this:
get(/^\/foo\/([^]*)$/, req => {
const [match] = req.params;
console.log(match);
//=> whatever/requested.jpg
});
I would like to be able to name my capture groups like this and also have the ability to define the options sent to url-pattern
.
Pedro Nauck commented
In the new release you can do that passing the path argument as a UrlPattern instance
Kevin Mårtensson commented
Sweet, thanks!