question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

catch urls like /team/:teamID and /team/:teamID* (wildcard)

See original GitHub issue

Coming from this example: https://codesandbox.io/s/reverent-tesla-c0kq0 I would like to understnad if this is possible in Navaid now:

const router = Navaid()
    .on("/", () => draw(PageHome))
    .on("/teams", () => draw(PageTeamList))
    .on("/team/:teamID/*", obj => draw(Team, obj))
    .listen();
  • using .on("/team/:teamID/*", obj => draw(Team, obj)) doesn’t catch urls like “/team/1”
  • using .on("/team/*", obj => draw(Team, obj)) catch urls like “/team/1” but as params in Team component I need the :teamID parameter which is wild in this case; the problem is if the URL is eg. like “/team/1/2/56/8” wild is 1/2/56/8 which is a wrong var in my Team component code.

UPDATE:

I need also something like this to catch: /team/1/shirt/5.

Is there a way to catch both using something like /team/:teamID* where * here is a wildcard after :teamID?

I hope I was clear. 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lukeedcommented, Apr 20, 2020

My first thought is that all your routes will load the chunks immediately. They’ll still be code-split but that doesn’t help on its own if you’re loading everything upfront anyway.

My second thought is that I, personally, wouldn’t reach to make an abstraction if you’re only using this twice (main + 1 sub resource).

I can get to a computer later tonight and look at anything else in particular you’d like me to

1reaction
frederikhorscommented, Jun 4, 2019

Ok, ok. I now. Thank Luke. God bless you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I search for URLs using wildcards? - FullStory Support
Yes! Use the “matches” URL operator to search against dynamic URL paths using a special syntax. Start your search using the event filter......
Read more >
Get-TeamTargetingHierarchyStatus - Microsoft Learn
Get the status of a hierarchy upload (see Set-TeamTargetingHierarchy) ... to get the proper Group ID for each team. TeamID in row 3...
Read more >
Wildcard URL Matching - SharpSpring Help
SharpSpring's wildcard URL matching feature allows you to create triggers for page visits with changing URL extensions.
Read more >
Wildcards and regular expressions in URL
Wildcards and regular expressions in URL. Wildcards. Kerio Control allows using wildcards when you create a content rule based on a URL or...
Read more >
Routes - React Location - TanStack
The text that matches a wildcard is extracted under the * key and is usable in many places like loaders, importers and elements,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found