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 trialSteven Rice
11,672 PointsHow Node.js works is confusing me.
I'm creating a web application on my localhost (using XAMPP) and I wanted to use Node.js to interact with my MySQL database.
I can understand the code being taught in the lessons. I've learned what code to write in order to add things to my database, and pull things from the database and display it.
However, I guess I'm missing the "big picture" idea of what Node.js is exactly.. and how it works. As I'm going through Node.js lessons I'm not understanding why we're using the Terminal to do things. I feel like I'm missing some prerequisite information. I'm also confused if I can even use Node.js on my web application if it requires terminal commands to get it to work.
Another question that might lead to the answer I'm looking for is... "If I create a web application using node.js on my localhost and try to use it, would it be able to interact with my database successfully without using the terminal?"
Another question would be... "If I uploaded the web application to an actual online web server so I can be used by people on the internet, how would it work since I can't use terminal commands?"
I'm definitely missing a key piece of knowledge somewhere. Thanks!
1 Answer
Steven Parker
231,269 PointsNode.js is essentially just a JavaScript engine that runs on the server instead of in the browser. Console commands are useful for development and testing, but should not be necessary for deployment. But even so, most servers that support node.js would provide a console interface for configuration and setup.