[radix3/rou3] Is creating the router dynamically per request fine? #40
Unanswered
lockinmarv
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
I need to match a pathname to dynamically generated routes based on a record ID in the database.
For that I send the ID to the API, get the record and then create the router with the dynamic paths of that record.
Is this an issue if I create the router on every request (with the ID) dynamically or would it be fine to do that because it's lightweight anyway?
If there is a better way, I'm open to suggestions. An idea was to use
path-to-regexpinstead but this doesn't handle sorting etc. of the routes and I need to find the best match (if any).Beta Was this translation helpful? Give feedback.
All reactions