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 Node.js Basics (2014) Building a Command Line Application Making a GET Request with http

Require http module?

How do we require http module, the video didn't explain or i didn't understand?


1 Answer

Colin Marshall
Colin Marshall
32,861 Points

The second part of stage 1/4 of this challenge asks you to assign the variable http to the require statement. You have the require statement correct, now just set a new variable called http and make it equal to the require statement.

It worked. Thanks.

I will also just drop this in as well just in case you missed it in the teachers notes to the https://teamtreehouse.com/library/nodejs-basics/building-a-command-line-application/making-a-get-request-with-http video.

"On October 20th 2015, we upgraded our website to only use HTTPS rather than just HTTP. This mean more security for anyone using our site.

This does include some breaking changes to our code. But it's simple to fix.

Replace any references to http to https. For example:

var https = require("https");

Modify any links from "http://teamtreehouse.com/" to "https://teamtreehouse.com/"."