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 trialRifqi Fahmi
23,164 PointsShouldn't we supposed to add response.end() ?
I didn't add this code and my chrome browser keep spinning and not load the content. After I add this the problem is solved. response.end() indicate that the request is complete CMIIW. I think the teacher should add this to teacher note. Thanks :)
1 Answer
Seth Kroger
56,413 Pointsend() isn't normally needed in Express like it is in vanilla NodeJS. Express should insert the end() automatically. I did double check my old source for the course and the bit in the video works in my Chrome without perma-spinning. Perhaps there's a subtle difference in your code causing Express to skip inserting the call to end()?
Rifqi Fahmi
23,164 PointsRifqi Fahmi
23,164 Pointsoh how foolish i am after checking the code, I type response.write() instead of response.send() haha