Book Image

Learn Node.js by Building 6 Projects

By : Eduonix Learning Solutions
Book Image

Learn Node.js by Building 6 Projects

By: Eduonix Learning Solutions

Overview of this book

<p>With its event-driven architecture and efficient web services capabilities, more and more companies are building their entire infrastructure around Node.js. Node has become a de facto part of web development that any serious developer needs to master.</p> <p>This book includes six Node.js projects that gradually increase in complexity. You'll start by building a simple web server and create a basic website. You will then move to create the login system, blog system, chat system, and e-learning system.</p> <p>By creating and following the example projects in this book, you’ll improve your Node.js skills through practical working projects, and you'll learn how to use Node.js with many other useful technologies, such as ExpressJS, Kickstart, and Heroku.</p>
Table of Contents (12 chapters)

Chapter 4. The Node Blog System

In this project, we will be building a simple blog system using Node.js and Express. We will use a few other things that we haven't used before. We will use something called Monk, which is similar to Mongoose; it's an ORM that is used to interact with our MongoDB database. We will use form validation with the Express validator. We will be able to upload images using a module called multer; also, we  will use a module called moment, which allows us to format dates and times.

Let's first look at a simple example. We have two posts with a featured image. When we click on the post link, it takes us to the single view and gives us a comment form where we can add comments:

To test this, let's say Hey, great post and click on Add Comment; you can see that now that comment has been added. We don't have the login functionality because it would just make the section exhaustive; however, you can use the nodeauth program that we built in the previous chapter, and implement...