Microservices in NodeJS

Microservices architecture in NodeJS is a group of loosely-coupled services that works independently of each other. Failure in one service does not affect the other services in the system. Consider each service as a separate server or system. For example, you have a social networking website. So you can create one microservice that handles all …

Custom middleware in Node JS

Middleware in Node JS is called before the request is handled by the router function. They stand between the router and the request. Middlewares are great when it comes to processing and validating request values before they reach the route. Make sure you have downloaded and installed Node JS in your system first. You can …

Call function when user stops writing input field – Javascript

In this article, we are going to show you a technique that helps you call a function when the user stops writing in an input field, using Javascript. Suppose you have an input field for search and you want to show search suggestions to the user as he types. So typically you do the following: …

2 ways to disable chrome autocomplete on input fields

Google Chrome by default autocomplete the input field. The HTML autocomplete attribute no longer works on chrome. We present to you 2 methods you can use to disable the autocomplete feature for input fields in chrome and other browsers. 1. Set input DOM value When the page loads, wait for half second, then set the …

Practical difference between async await and callback

In one of our tutorial, we learned how to create a function in async await and how to create a function that uses callback. Video tutorial: Asynchronous Let’s say you want to send an email to a user. Following is a Node JS code that sends an email using a callback: In your terminal, you …

A guide to MEVN

MEVN stands for Mongo DB, Express JS, Vue JS, and Node JS. It is a technology stack used by developers to create full-fledged web applications. Most of the applications created in the MEVN stack are single-page applications. But it is up to you if you want to single page or multi-page web application. Table of …

Add or update URL query parameter in Javascript

Create the following function in Javascript to add or update URL query parameter. Now, whenever you want to add or update the URL, simply call the function in the following way: The first parameter will be the key of the parameter, and the second will be the value. window.location.search: will return all the query parameters …