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 trialGreg Wienecke
126 PointsDid 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 .
11,414 Pointshttps://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.
Brian Wright
6,770 PointsThe 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
5,768 PointsYes I was wondering about what an EventEmitter is? Wish they went over it.
Bryan Simca
9,470 PointsBryan Simca
9,470 Pointsyes but he didn't explain about the EventEmitter from profiles.js