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

Thomas Santoro
Thomas Santoro
4,007 Points

User route fails - 502 Bad Gateway

https://w.trhou.se/315t9v851d

Snapshot above. Two questions: (1) The home route works fine, but my user route consistently gives me the bad gateway error. Can't seem to spot the error. (2) Why doesn't the console kick back an error on this? Thanks for any help!

Thomas Santoro
Thomas Santoro
4,007 Points

For context, this is what a Microsoft webpage says about this error. It doesn't make sense: why would the treehouse site not fail for my Home route but would for my User route, especially since i can still do the 'ol https://teamtreehouse.com/username.json thing and it works fine. I'm still missing both the what and the why of this problem...

"The 502 Bad Gateway error is usually a network error between servers, meaning the problem is not with your computer or internet connection. The error may be temporary. Try refreshing the webpage or re-enter the address in the address bar and check. Trying to reload the page often fixes the issue. Since the 502 Bad Gateway error message is an issue with the web site's network, there could be a technical glitch from the server. You may want to wait for a while before loading the website."

Hello, Your "username.length" is incorrectly written..