Welcome to this introduction to NodeJS! In the following chapters I covered all the basics you need to get started in development for NodeJS. I tried to be as precise as possible, leaving out all the cluttering bells and whistles in an attempt to give you a clear view of only the important parts.
Here’s what you’re up for:
- Installation
- Hello World
- The Package Manager
- Hello World - The Next Level
- Project Structure
- Working With HTML
- Adding CSS and JavaScript
- Basic Routing
- User Input
- Advanced Routing
- Controllers
- Organizing Views
- Templates
- Sessions
- Databases
- Mongoose
- Authentication With PassportJS
- Conclusion
Let’s start at the beginning: Installing NodeJS on our system (I’m working with Ubuntu here, commands might differ depending on your distribution). Since the package in the official repository isn’t always up-to-date, we have to get the latest version using this command:
|
|
This will install the current version:
|
|
Now we need a folder to give our project a home. You can obviously call it whatever you like, I will be using node_tutorial
|
|