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...