Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. What are the usage of the req.route() in express ?

What are the usage of the req.route() in express ?

Scheduled Pinned Locked Moved Web Development
question
3 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 14479161
    wrote on last edited by
    #1

    i am new at express and i went through the documentation and i want to know what are the main usage of the req.route() in express it only gives me information about the route nothing else but what can i use it in real life. What I have tried: i have read in the main documentation but there is no details about usage of this method specifically

    J D 2 Replies Last reply
    0
    • M Member 14479161

      i am new at express and i went through the documentation and i want to know what are the main usage of the req.route() in express it only gives me information about the route nothing else but what can i use it in real life. What I have tried: i have read in the main documentation but there is no details about usage of this method specifically

      J Offline
      J Offline
      jhonaa
      wrote on last edited by
      #2

      app.use() — Routes an HTTP request, where METHOD is the HTTP method of the request, such as GET, PUT, POST, and so on, in lowercase.

      1 Reply Last reply
      0
      • M Member 14479161

        i am new at express and i went through the documentation and i want to know what are the main usage of the req.route() in express it only gives me information about the route nothing else but what can i use it in real life. What I have tried: i have read in the main documentation but there is no details about usage of this method specifically

        D Offline
        D Offline
        deepok1
        wrote on last edited by
        #3

        req.route() will give you the complete requested URL and the req.path will give you only the current page like /mypage.html

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups