Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Using Hapi.js, Mongoose, And MongoDB To Build A REST API

To continue on my trend of MongoDB with Node.js material, I thought it would be a good idea to use one of my favorite Node.js frameworks. Previously I had written about using Express.js with Mongoose, but this time I wanted to evaluate the same tasks using Hapi.js.

In this tutorial we’re going to develop a simple RESTful API using Hapi.js, Joi and Mongoose as the backend framework, and MongoDB as the NoSQL database. Rather than just using Hapi.js as a drop in framework replacement, I wanted to improve upon what we had previously seen, by simplifying functions and validating client provided data.

Read More

Hash Password Data In MongoDB With Mongoose And Bcrypt

When creating a web application that handles user information it is a good idea to protect anything considered sensitive rather than storing it as plaintext within a database. The goal is to make it as difficult as possible for a malicious person to obtain access to this sensitive information. Rather than encrypting sensitive information with the knowledge that it can one day become decrypted, it is better to hash this sensitive data instead because hashing is a one-way process.

In this tutorial we’re going to take a look at hashing password data with bcryptjs before storing it in a MongoDB NoSQL database with Mongoose and Node.js.

Read More

Building A REST API With MongoDB, Mongoose, And Node.js

About a week or so ago I had written a tutorial titled, Getting Started with MongoDB as a Docker Container Deployment, which focused on the deployment of MongoDB. In that tutorial we saw how to interact with the MongoDB instance using the shell client, but what if we wanted to actually develop a web application with MongoDB as our NoSQL database?

In this tutorial we’re going to see how to develop a REST API with create, retrieve, update, and delete (CRUD) endpoints using Node.js and the very popular Mongoose object document modeler (ODM) to interact with MongoDB.

Read More

Query A GraphQL API With Vue.js And Axios

I’ve written quite a bit of content around developing a GraphQL API with various programming technologies such as Node.js, Golang, and Java. Heck, I even wrote an eBook on the subject titled, Web Services for the JavaScript Developer. However, I haven’t really produced any content around interacting with those APIs using modern frameworks and client facing technologies, only cURL and Postman.

So how do you interact with a GraphQL API using something like Angular, React, or Vue.js?

There are a lot of frameworks to cover, but in this particular tutorial we’re going to see how to use Vue.js and simple JavaScript to interact with a GraphQL API.

Read More

Perform Different Text Animations With jQuery

When it comes to my name, there is often a lot of confusion. On social media sites such as Twitter, GitHub, and similar, I often go by nraboy which is the first character of my first name (Nic) followed by my last name (Raboy). When people see that, they often think of The National Rifle Association (NRA), which is obviously unrelated to what I’m trying to present myself as. However, due to the NRA acronym being similar to my online handles, I get included on a lot of crazy conversations that I really don’t want to be a part of. In fact, it is one of the main reasons why the blog was rebranded from blog.nraboy.com to thepolyglotdeveloper.com.

Out of this I decided to create an animation showing the obvious. Rather than putting my video editing skills to the test, I decided to create an animation using jQuery and simple JavaScript. In this tutorial we’re going to play around with some text animations using jQuery.

Read More

Implementing U2F Authentication With Hardware Keys Using Node.js and Vue.js

Not too long ago I had written a tutorial titled, U2F Authentication with a YubiKey Using Node.js and jQuery, which demonstrated how to use hardware keys as a means of universal two-factor (U2F) authentication. However, I had left some things to be desired in that previous post. For example, the previous tutorial did not use proper session management with Express.js and it used jQuery, which is neat, but by no means is as popular as some of the other web frameworks that currently exist.

In this tutorial, we’re going to expand upon what we had done previously, but implement proper session management with Express.js and use Vue.js, which is a modern web framework.

Read More

Manage Sessions Over HTTPS With Node.js And Vue.js

A long time ago when I had been exploring session management in Node.js, I had written a tutorial titled, Session Management in Your Express.js Web Application. This was a basic tutorial that is still very functional today, however little things have changed since then when it comes to how the web works. For example, in 2015 HTTPS was never a requirement and we weren’t exposed to all the frontend web frameworks that exist today.

When you start introducing things into your web applications such as HTTPS or micro-services that operate on different origins or ports, or frontend frameworks, session management can get a little more complicated. We’re going to see how to maintain a session for a user using Node.js with Express.js on our backend and Vue.js on our frontend, in this tutorial.

Read More