Transform a path into a match function. Memoized: each unique route path compiles its regex once
and reuses it across every request. Hot paths in the request lifecycle (matchUrlToRoute) used
to recompile on every call, which dominated CPU on apis with many routes.
Transform a path into a match function. Memoized: each unique route path compiles its regex once and reuses it across every request. Hot paths in the request lifecycle (
matchUrlToRoute) used to recompile on every call, which dominated CPU on apis with many routes.This is from the path-to-regexp package.