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 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

https://teamtreehouse.com/library/nodejs-basics-2

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.