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

Greg Wienecke
Greg Wienecke
126 Points

Did I miss the part where he creates profile.js?

He requires profile.js and uses some code from that module, but as far as I can tell, we never got to even see profile.js.

I'm assuming it makes a request to the treehouse API...

I guess I'll download the course files and check it out, but it seems a bit odd that this course is about creating a dynamic site, but the part that makes it dynamic isn't shown or explained.

2 Answers

Happy .
Happy .
11,414 Points


Andrew runs through with the set up to send the request and parsing the data returned, based on a username.

yes but he didn't explain about the EventEmitter from profiles.js

The profile.js file returns an object which is lo itself an EventEmitter. It looks like it is there to simulate the response events from the server without having to handle them asynchronously or rewriting the same get requests in all the router methods..

Clint Oka
Clint Oka
5,768 Points

Yes I was wondering about what an EventEmitter is? Wish they went over it.