Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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?

app.js
require('http');

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/"."