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.

App mount path stripped to a of cardinality of 1

See original GitHub issue

Hey, thanks for writing this. I’m a huge fan of Express/NodeJS web service alternatives.

It looks like the cardinality of the mounting path of each middleware/app is stripped to a limit of 1.

Example:

const app = require('polka')();

app
    .use('/foo/bar/baz', function(_, res) {
        res.end();
    })
    .listen(3000);

If I visit localhost:3000/foo/bar/baz, I will get a 404. I think this is because of the value function, it checks for the first slash after the leading. So, if I provide:

/foo/bar/baz, the first slash is the zeroeth position of the string and the string itself is stripped to foo.

Is this by design? If this is done in error, it can easily be fixed with some language around how the trailing slash should be considered, or by using lastIndexOf. It also works if I just don’t consider the value function at all.

Additionally, it looks like there is a mountpath instance property, but it is not set from the constructor, perhaps this could be used in some way?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
lukeedcommented, Jun 9, 2019

Looks to be okay @Conduitry – linked the latest commit to here as a follow-up

1reaction
aubergenecommented, Sep 26, 2019

Opps, sorry my lack of experience with installing version tags. All good now! Fix works, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - App mount path stripped to a of cardinality of 1 -
App mount path stripped to a of cardinality of 1. ... It looks like the cardinality of the mounting path of each middleware/app...
Read more >
Cardinality aggregation | Elasticsearch Guide [8.5] | Elastic
This cardinality aggregation is based on the HyperLogLog++ algorithm, which counts based on the hashes of the values with some interesting properties:.
Read more >
Math Flashcards - Quizlet
Have the same cardinality by describing an explicit one-to-one correspondence between the two sets. Fives take over. Let EIF be the set of...
Read more >
Untitled
Best daily deal apps for iphone, Mk5613 ernest jones, Wishahmon blog, ... Mount wilson trail head, Flammas eius, Electoral roll bridge of allan, ......
Read more >
IhF - River Thames Conditions - Environment Agency - GOV.UK
Riflessivo proprio apparente reciproco, Modic 1 endplate, Faux wood panelling ... Popular z boy names, Rebel flag wallpaper app, Til4 chemical name, ...
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