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 Build a Simple Dynamic Site with Node.js Creating a Simple Server in Node.js Preparing & Planning

Giovanni Dalla Rizza
Giovanni Dalla Rizza
10,637 Points

Help with Preparing & Planning

I'm on Node just for few days and this is the first time I write code server-side. Can someone could give me help explaining point 2 and 3 of solution procees?

Points are:

  1. handle HTTP route GET / and POST /
  2. handle HTTP route GET /:username

Thanks! Those lessons confuse me a little bit!:D

Here is my understanding

  1. HTTP is the structured text that both the server and the client is expecting. It is the language, or protocol, that everybody is agreeing to communicate with.

  2. GET and POST... these are the HTTP verbs (and methods) associated with what you are trying to do. Generally, when you submit a form, you are using POST. When you are retrieving information, you are using GET. There are others, but GET and POST are the most commonly used. http://www.restapitutorial.com/lessons/httpmethods.html

  3. The ROUTE is both the HTTP method (GET/POST) AND the full path. So... one route will be http://www.awesomeurl.com/ and another will be http://www.awesomeurl.com/myusername. Both of these will likely be GETs, but they will act differently based on the route. In this case, the first will display the home page. The second will display the results.