SitePoint
Blog
Forum
Library
Login
Join Premium
Toggle sidebar
Your First Week With Node.js, 2nd Edition
Toggle community discussions
Close
Content
Bookmarks
Preface
Your First Week With Node.js, 2nd Edition
Notice of Rights
Notice of Liability
Trademark Notice
About SitePoint
Who Should Read This Book?
Conventions Used
1
What Is Node and When Should I Use It?
What Is Node.js?
How Do I Install Node.js?
Introducing npm, the JavaScript Package Manager
What Is Node.js Used For?
Node.js Lets Us Run JavaScript on the Server
What Kind of Apps Is Node.js Suited To?
What Are the Advantages of Node.js?
Other Uses of Node
Conclusion
Build a Simple Page Counter Service with Node.js
Prerequisites
Project Overview
Page Hit v1.0: In-memory Storage
Page Hit v2.0: File Storage
Job Done?
Understanding module.exports and exports in Node.js
Different Module Formats
Requiring a Module
Creating and Exporting a Module
Exporting a Default Value
What’s the Difference Between module.exports and exports ?
Conclusion
Forms, File Uploads and Security with Node.js and Express
Setup
Displaying the Form
Form Submission
Validation and Sanitization
The Valid Form
Security considerations
File Uploads
Thanks for Reading
Working with Databases in Node
What is a Database?
Prerequisites
The Core Node.js Application
MongoDB Version
MySQL Version
Sequelize ORM Version
Next Steps
How to Build and Structure a Node.js MVC Application
What is MVC?
Laying out the Foundation
Storing Our Settings
Defining the Routes
Building the Models
Building the Controllers
Building the Views
Serving Static Files
Conclusion
Local Authentication Using Passport in Node.js
Prerequisites
Authentication Strategies: Session vs JWT
Creating the Project
Setting up Express
Setting up Passport
Creating a MongoDB Data Store
Connecting Mongo to Node with Mongoose
Implementing Local Authentication
Routes
The Client
Next Steps
Conclusion
How to Debug a Node App
What is Debugging?
How to Avoid Bugs
Node.js Debugging: Environment Variables
Node.js Debugging: Command Line Options
Console Debugging
Node.js util.debuglog
Debugging with Log Modules
Node.js V8 Inspector
Node.js Debugging with Chrome
Node.js Debugging with VS Code
Other Node.js Debugging Tools
Get Debugging!
Node Testing for Beginners
What Testing Is
Basic Assertion Testing Built In
Structuring Your Tests
Frameworks for Automated Testing
Get Started Now
How to Use SSL/TLS with Node.js
HTTPS Everywhere
Basic Communication
HTTPS
Generating Certificates
Tighetning It Up
Conclusion
Configuring NGINX and SSL with Node.js
Installing NGINX
Setting Up a Node.js Server
Configuring NGINX
Setting Up SSL
Bonus: Serving Static Assets
Conclusion
Using Docker for Node.js Development
“But it Works on My Machine!”
Virtual Machines
Docker Overview
Docker Concepts and Terminology
How to Launch a Database Container
How to Launch a Node.js Container
Using Docker Compose During Development
Using Docker Compose in Production
Cleaning Up
Next Steps
Open text modal
Community Questions
Close