Question about Node Express

Ive been waiting to learn back end things for so long. This is by far my favorite chapter yet. Its also super hard for me even though i find it interesting.

I am wondering what the ‘colon’ stands for in a url.

like http://freecodecamp/:word/index.html

what does the colon do before word?

for some reason i keep thinking it means that anything can be substituted after the colon but before the next forward slash.

Or maybe that’s just in the express method paths?

Im just having a hard time researching because i dont even know what the terms are for those parts of the url.

Yep, it’s called route parameter. It’s a way to capture a value in the URL position

Route path: http://freecodecamp/:word/index.html
Request URL: http://freecodecamp/awesome/index.html
req.params: { "word": "awesome" }

Hope this helps :smile:

thank you so much. i couldnt figure out if it was something permanent or used for a value.

appreciate the help

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.