Next.js Discord

Discord Forum

middleware path-to-regexp matcher

Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
In the middleware documentation, it refers to the path-to-regexp module documentation on how to define the matcher paths. Is it using that module internally to execute the matching? I did not find it in the installed packages, so I don't expect it does. However, if it is doing that, can I access the result of the matcher to pull out my path components in middleware? Right now I'm just re-running the path-to-regexp matcher on one of my routes to pull apart the URL but that's redundant if it already done internally.

0 Replies