Adds exception to '@' case - #59
Conversation
Thought it would be a nice addition to add root domains
bmullan91
left a comment
There was a problem hiding this comment.
Thanks for the PR 🙌 - can you add some colour to help me better understand why people would do this, it seems nonintuitive to me. If we are to include this we'll need tests + a readme update to go along with it.
i think that's how you do it
|
o/ is this good? I'm not very common with tests and socializing with other humans |
Because sometimes you just want to handle the root domain, not forcibly the other ones for instance, if I were to choose for 'api.example.com/about', id rather throw a 404 that would make sense to the dev than a successful request that would confuse them |
|
Hello? I really want this PR to get merged, it's gonna facilitate a lot of things for me and for other people asw (I hope) @bmullan91 |
|
Hi! So, to clarify, you can't go into any Since it is the norm, I would expect to see it here as well |
|
I know it's been a long time since this PR, but I actually have this usecase as well. My original code: Means that if anyone visits the (nonexistent) To deal with this, I have had to add a specific check for unknown subdomains, like the following: If the change from this PR was introduced, I could simplify to something like: Unhandled/unknown subdomains would get the standard 404 behavior, and/or I could add my own global 404 after these statements, without having to do the req.subdomains check that I am currently doing. |
|
Honestly, this package looks and feels abandoned. You're better off making a fork and publishing it under an org with your name (iirc I have that under |
Thought it would be a nice addition to add root domains