Skip to content

Add to docs information on routing URLs #716

Description

@dougwilson

So there was the issue expressjs/express#3088 filed in Express recently regarding confusion about how Express handles routing when the incoming URL is a full URL instead of just the path (i.e. GET http://localhost/ HTTP/1.1 vs GET / HTTP/1.1). I browsed around through the docs and it doesn't seem super clear.

I can see two possible ways to enhance the documentation around this:

  1. In the routing section, we can probably call out that the path argument matches only against the pathname part of the request URL and nothing else. This is an indirect answer to a lot of the matching questions like the above as well as calling out that no, it does not match against the query part, host part, etc.
  2. If we want to, we can explicitly call out that any scheme, auth, host, querystring, etc. in the request URL are ignored during the routing. Perhaps we can show an example of http://localhost/foo?bar=1 only routing against the /foo part.

Anyway, those are some of my initial thoughts on the docs from that issue :)

Activity

  1. crandmck commented on Sep 26, 2016

    @crandmck
    Member

    I agree that we need to clarify this in the docs. I can see how it would (did?) lead to some confusion. So your two suggestions @dougwilson seem like a really good place to start.

  2. locked and limited conversation to collaborators on Aug 2, 2025
  3. converted this issue into a discussion #2009 on Aug 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions