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 trial

JavaScript Express Basics (2015) Doing more with Express Using Logic in Jade Templates

norman ebuen
seal-mask
.a{fill-rule:evenodd;}techdegree
norman ebuen
Full Stack JavaScript Techdegree Student 12,714 Points

req.path?

can someone explain it more? i don't really get it.

Edwin Carbajal
Edwin Carbajal
4,133 Points

Hi 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: '/blog/any url you want'
}

req.path is the same as req.url