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 Handling Routes in Node.js Populating User Information

Samuel Tissot-Jobin
Samuel Tissot-Jobin
7,350 Points

events.js Error 141 Error: Socket Hang up

hello all,

I have been having some difficulty implementing the code in a local environment (localhost on my machine)

the line in the profile.js file causes the error 141 Socket hang up

var request = http.get("http://teamtreehouse.com/" + username + ".json", function(response) {...}

my server is runs fine until I try to get a request from treehouse. server

http.createServer(function (request, response) {
  router.home(request, response);
  router.user(request, response);
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');

-- I would like to point out that it works perfectly on the workspace --

I have looked and there it does not seem to be a firewall issue... I'm lost here.