What is NPM(Node package manager): Complete Guide

NPM is the biggest repository for any programming language and has almost every package you need in a web or mobile development project. The npm means the node package manager.  The topics we cover are the following. NPM Topics Overview of NPM Attributes of package.json Updating NPM packages NPM Versioning Semantic versioning Global and local installation of … Read more

How to Update Node Version on Mac in 2022

Node.js version 18.3.0 is currently the latest, and yours might differ depending on when you read this article. Web Development is changing rapidly. Development is picking rapidly, and Node.js is shipping out the new version to almost everyone; therefore, it is nice to have the latest version in your development environment to test the new … Read more

How to Setup Node Express and MongoDB in Docker

Docker has become a standard tool among DevOps and Infrastructure people and for the daily work of any developer. This article is aimed at Docker beginners who want to get a fully working instance of a Node Express and MongoDB app up and running in a matter of seconds for daily work.  Setup Node Express … Read more

Node Socket.io: How to Use Node.js With Socket.io

We will build a simple chat app today. We will use Node.js for the backend platform and Socket.io for real-time two-way communication. First, we need to create a package.json file to install our required dependencies. Node Socket.io WebSocket is the internet protocol that allows for full-duplex communication between servers and clients. This protocol goes beyond the … Read more

React Express: The Complete Guide in 2022

For this example, we will use React js as a frontend library, node.js as a backend server platform, and MongoDB as a database to store the data. React Express React is a front-end JavaScript library, and Node.js is a back-end platform using the Express web framework. React Express Tutorial will help you set up both … Read more

How to Serve Static Files in Express

Express is the Fast, unopinionated, minimalist web framework for Node.js. We can also build the robust api using HTTP utility methods and middleware at your disposal.  How to Serve Static Files in Express To serve static files in express, use the express.static() function. The static files such as images, CSS, and JavaScript files using the … Read more

Express Router: How to Use Routing in Node.js

Express apps utilize routers that are essentially containers for a set of middleware. We can put this middleware holder only on a specific route, which allows us to keep our logic in separate files and bring them together on our terms. Express Router Express Router is a built-in class that refers to how an application’s … Read more

process.env: How to Use Environment Variables in Node

Working with environment variables is a great way to configure different configurations of your Node.js application. Many cloud hosts like Heroku, Azure, AWS now.sh, etc., use node environment variables. Likewise, node.js modules use environment variables. Hosts, for example, will set the PORT variable that specifies on which port the server should listen to work properly. In addition, … Read more

What is Session in Express and How to Use in Node.js

As we all know, HTTP is a stateless protocol. We need to identify the request and associate each request to the user if the user has already arrived before. So to persist data across the multiple pages, we use sessions. Express session To create a session in the express framework, use the express-session package. The express-session … Read more

Node Express Tutorial: Complete Guide in 2022

Express js is a minimal and flexible Node.js web application framework that provides robust features to develop web and mobile applications. We can build Web APIs through this framework very quickly, and it has tremendous support for the NoSQL databases like MongoDB. You can refer more about Node js Express js Framework on its Official … Read more

How to Handle an Error in Express.js

One of the most crucial things in building web applications is error handling. The system will depend on many services, databases, and consumers; the unexpected becomes expected. Databases will fail, services become unavailable, server timeout. So your consumers won’t be calling your endpoints with the parameters you would expect. To prepare your application for such scenarios, you … Read more