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

node.js server not being created properly

The server does not seem to be created properly. I am using node.js , I am using the https version of the createServer module however the "hello world" code is not being written on the port that I have programmatically dictated. When I try and preview the progress on the port I specified, I get an error stating workspace not available. Is this a workspace error? My code seems to be identical compared to the lesson . here is the snapshot of the my code so far. : https://w.trhou.se/ma1dxfvo17

To anyone that is reading this question I have solved the issue by changing the server type from https to http, However I am still curious on why the https module was causing this error and the http module was not, if someone could explain I would greatly appreciate it. Thanks.

1 Answer

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Yep flipping the https module to the http does work. I believe it does't "just work" because https requires SSL certificates for the server to initialize properly for secure communication. See the code in the first answer on this stack overflow to see what steps you'd need to do with SSL.

Thank you Andrew I really appreciate that! also thanks for finding the info for finding the steps for the ssl. just one more thing to play around with. Cheers!