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

Juan García
Juan García
10,723 Points

Trouble previewing a Node.js application on Workspaces

I'm currently going through the "Build a dynamic site with Node.js" course. Following the instructions step by step, I have no problem running the server on node and previewing the results returned by the app. Of course, when I make a request to "https://teamtreehouse.com/myusername", I receive a warning that the user has been moved permanently.

I am aware that treehouse has now moved the API to https, so I go ahead and change every http method to https (keeping http for status codes). The problem is, the preview then doesn't display the results requested, but a warning:

"Workspace Unavailable This is a preview link for a Treehouse Workspace that is not currently active. If you are the workspace owner, you can launch it again via the Treehouse site."

Here's a snapshot of my code (it's basically the code provided for by Andrew, with the changes to the http methods: https://w.trhou.se/265ai7uns5

I don't know if I'm doing something wrong, or if maybe the exercise is now outdated?Anyway, it's quite frustrating, I try to keep going with the course but it's hard without being able to see the results of my work!

Any advice? Thanks a lot!

1 Answer

Steven Parker
Steven Parker
229,732 Points

Be aware that the URL of a workspace changes every time you launch it. Any reference to the workspace URL in your code will need to be updated every session.