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

Curious how Javascript can be used as a Web Server.

In the second video in the Javascript series the instructor mentioned that Javascript can be used as a web server. I never knew this. Can someone explain how in relatively simple terms...or refer me to a basic resource to learn more? Thanks!

2 Answers

Hello :)

Node.js is what you are looking for! You can follow the link below which takes you to the course on Node.js. The trailer for the course will tell you what Node is all about and the first few videos will go into a little more depth of how it works.

Here: https://teamtreehouse.com/library/nodejs-basics

Mean stack!

You would use express as a server. Then you would deploy with heroku or digital ocean or whatever offers a vps. Node is more involved because you have to write your own web server vs where the lamp stack. Apache you just drag and drop files in. Which you don't write you own server.

Express is the framework on top of node to create your rest api to serve your web application.

I would recommend the javascript full stack course. learn angularjs, npm, express, node, and ejs. Angular part not as important if you know ejs. It will be a MEN stack instead of SPA. Single page application.

If not just learn angular and firebase. Firebase is backend service that has mongodb and login built in. So all you have to worry about is the front.

Anyways and happy hacking.