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.
Neil McPartlin14,662 Points
Hi Leo. I'm just pasting here lines 14 to 50 of your router.js file for reference.
1: Your home route is working fine, but as soon as you activate the user route by appending /chalkers, your server is crashing. The reason is that lines 44 and 45 are duplicates and should be removed. The teacher (Andrew) is doing a lot of cutting and pasting in the video and it is very easy to lose track of where you are. So just remove these lines...
response.write(username + "\n"); response.end("Footer\n");
2: Now the GET request is working but you see this in your browser.
Header chalkershas 209badges. Footer
In line 35, the response.write entry is using concatenation and the spaces need to be inserted next to the strings, within the apostrophies. It seems you don't need a space before each '+' but it does look better if you put one there.
response.write(values.username+ "has " + values.badges+ "badges.\n");
response.write(values.username + " has " + values.badges + " badges\n");;
Now we see...
Header chalkers has 209 badges Footer
You mentioned not seeing points either. In this particular video, Andrew doesn't actually do that but you can do this yourself by adding to the response.write entry we covered above.