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

Create A Self-Signed Certificate For Node.js On MacOS

I recently picked up a Yubico U2F hardware key and thought I’d try to create a web application that was protected with two-factor hardware-based authentication. Things were going smooth until I realized that it is mandatory to be using HTTPS within your application, even when testing locally. HTTPS is common, but I’d never actually set it up with Node.js because I had always been using services like Cloudflare that configure it for you. The problem is that these services are for live domain names, not necessarily localhost.

While we’re not going to explore U2F hardware keys in this tutorial, we’re going to take a look at creating and installing a self-signed certificate for use in Node.js within macOS.

Read More

Building Amazon Alexa Skills With Node.js, Revisited

A little more than two years ago, when the Amazon Echo first started picking up steam and when I was first exposed to virtual assistants, I had written a tutorial around creating a Skill for Amazon Alexa using Node.js and simple JavaScript. In this tutorial titled, Create an Amazon Alexa Skill Using Node.js and AWS Lambda, we saw how to create intent functions and sample utterances in preparation for deployment on AWS Lambda. I later wrote a tutorial titled, Test Amazon Alexa Skills Offline with Mocha and Chai for Node.js, which focused on building unit tests for these Skills and their intent functions. Fast forward to now and a few things have changed in the realm of Skill development.

In this tutorial we’re going to see how to build a Skill for Alexa powered devices using Node.js and test it using popular frameworks and libraries such as Mocha and Chai.

Read More

Using An Exit Intent Listener To Manage Popups On A Page

Not too long ago I wrote a tutorial titled, Create an Email Subscription Popup with jQuery, that demonstrated how to create popup modals within your web application. In this example the modals were presented on a timer. If you hadn’t noticed, and I think most people did, The Polyglot Developer was using those modals for newsletter subscriptions exactly as demonstrated in the tutorial. The problem was that changes to the user experience on a timer felt intrusive no matter how long the timer. This was further validated through user feedback.

The feedback, which I always take seriously, lead me to changing how the modals were presented. Instead of using a timer, I had switched them to appear based on the users intent to leave the page or site. For clarity, an exit intent happens when the mouse leaves the website to interact with other things on the computer or within the browser.

In this tutorial, we’re going to see how to take action based on exit intents with simple JavaScript as well as jQuery.

Read More

Web Services For The JavaScript Developer, First Edition

I am pleased to announce the release of my first ever eBook titled, Web Services for the JavaScript Developer, which focuses on the development of REST and GraphQL APIs using JavaScript, Node.js, and various frameworks.

The book was designed to help make you successful at modeling and validating your data, designing queries, and anything related to creating web services.

Read More

Serving Gzipped JavaScript Files From Amazon S3

If you’re using Amazon S3 for a CDN, it’s possible to serve compressed, gzipped files from an Amazon S3 bucket, though there are a few extra steps beyond the standard process of serving compressed files from your own web server.

Read More

Build Electron Applications With Vue.js And Webpack

If you’re like me, you thought you’d try to build a cross-platform desktop application using the very popular Electron framework as well as the very popular Vue.js JavaScript framework. At first glance it might seem as easy as defining an Electron configuration, but in reality, a little more needs to be done when using Webpack to build the project.

I had written a few tutorials a while back around Electron, and even one with Vue.js, but in that example the Vue CLI and Webpack were not part of the equation. In this tutorial, we’re going to see how to create a new Vue.js application using the Vue CLI, configure it for use with Electron, and then deploy it in all its glory.

Read More

Developing A RESTful API With Node.js And MongoDB Atlas

Most modern web applications need to be able to handle data consumption requests and data manipulation requests from clients using HTTP. It is the norm to pass JSON data between these requests so it makes sense to use a NoSQL document database because JSON and similar is the common storage format, eliminating the need to marshal data to new formats in every request.

Lucky for us, leveraging these concepts and technologies is not a difficult task.

We’re going to see how to create a RESTful API using Node.js and Express Framework that communicates to a cloud instance of MongoDB called Atlas.

Read More