Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialnorman ebuen
Full Stack JavaScript Techdegree Student 12,714 Pointsreq.path?
can someone explain it more? i don't really get it.
Edwin Carbajal
4,133 PointsEdwin Carbajal
4,133 PointsHi Norman,
What are you not understanding? It's pretty simple. The 'req' parameter in your route, i.e
app.get('/blog/:title?', (req, res)
is an object. The 'path' keyword is an attribute of that object. When you call req.path, you are referring to the value of the attribute. Whenever you type a url, i,e
/blog/any url you want
it gets stored inside the req.path attr.
req.path is the same as req.url