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

How to do all this on a local machine?

Actually, I have everything installed.

  1. Node.js is installed
  2. The Project files downloaded.

And I'm running a Windows Machine.
Using the Powershell as the command line for Node.js

So I was wondering, how can I open files in the browser as done in the video through workspaces?What if I want to do it locally. With all the local tools. Without Workspaces. How would I do that? thank you for your time.
:confused:

4 Answers

Duy Khanh
PLUS
Duy Khanh
Courses Plus Student 4,911 Points

run in local its really easy . but i recommend reading the nodejs basic in w3school , it's really easy to know how its working . Belive me , it the second time i replay video again and match what teacher doing in w3school and note it to my file and now i really remmember and know what i learned . ;) Have fun :D

Zack Lee
PLUS
Zack Lee
Courses Plus Student 17,662 Points

You need to run a local server from the project directory...not sure how to do it on windows. But you could use an npm module like httpServer, or use a dev tool like gulp or webpack to run a server.

Oh, thank you for your time, Zack Lee. Actually, I'm looking forward to getting a more detailed solution, any resource for that? tnx.

Zack Lee
Zack Lee
Courses Plus Student 17,662 Points

Nafis Fuad there is a course on gulp in one of the javascript tracks. its a great dev tool and is really powerful, but requires a lot of setup.

http-server docs can be found here: https://www.npmjs.com/package/http-server install globally this is a much simpler solution. you can run the command: http-server [path] where path is a path to the directory you wish to pull from.

Oh, thank you, Duy Khanh. I'm gonna try it right away. :smile: