Node.js Blog Tutorial

Nodejs Blog Tutorial

In this tutorial we are going to build a blog powered by Node.js on the back end, Bootstrap on the front end, and MongoDB as the data store. We are going to start from scratch and build out the project one step at a time. We’ll see how to include all the packages we’ll need into Node for building the blog. Some of these include Express, Bcrypt, nodemon, express-edge, mongoose, body-parser, express-fileupload, and express-session.…

Node MongoDB Native

Node MongoDB Native

In this tutorial we’ll take a look at creating a simple application to track stocks in a watchlist or portfolio. In order to store this data, we’ll be using MongoDB – a popular NoSQL storage solution that is often used with Node.js. We’ll see how to create the directory structure to hold this stock watchlist application, and then install MongoDB Native using npm to save it as a dependency to the package.json file.…

Testing JavaScript With Jest

Testing JavaScript With Jest

As you build out an application, it is very easy to manually test things. You have been doing this since you started writing your first lines of code! How? Think about it. You write some code, save it, then run the code to see what the result is. Did it give you the result you wanted? Great! Then it worked. So if it is so easy to test the code you write, why write automated tests?…

JSON Web Token Authentication With Node.js

JSON Web Token Authentication With Node

Let’s now protect some endpoints by making use of JSON Web Tokens. What are JWTs? JSON web tokens are base64url encoded JSON Objects which are encrypted by the use of a private key. Embedded within the JWT can be one or more sets of name and value pairs. You might have things like a user id or user name embedded within the token. You can not see this data thanks to the encryption in place, but it can be deciphered on the server since the private key is available to the application.…

How To Add Routes and Models To Node Rest API

How To Add Routes and Models To Node Rest API

At the conclusion of our last tutorial which looks at working with Models in Mongoose, we now have a REST api which allows us to create new users and authenticate users. In a prior tutorial we also built out a restful resource for Games. In other words, we were able to create, read, update, and delete Games using the Node powered api. Now, we’ll once again go over the process of how routes files and model files work together in an express app.…