VOOZH about

URL: https://www.geeksforgeeks.org/node-js/url-monitoring-service-with-node-and-express-js/

⇱ URL Monitoring Service with Node and Express.js - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

URL Monitoring Service with Node and Express.js

Last Updated : 23 Jul, 2025

Learn to set up a URL Monitoring Service with NodeJS and ExpressJS. It tracks URL statuses and notifies of any changes. This course emphasizes simplicity for beginners while guiding on scalable and clean code practices. The system conducts health checks on multiple URLs to ensure availability over time.

Output Preview: Let us have a look at how the final output will look like.

👁 GIFRecording
Desired Output

Prerequisites:

Approach to create URL Monitoring Service

  • We will use a in memory data structure (kind of map) to store the url and its health check status
  • setTimeOut is a very handy function that we will use here to check the url status at regular intervals
  • Basically, at every interval we will use axios library to make a HTTP call to the target url for their status check.
  • We will need to have another endpoint to stop the monitoring else it will keep on going to monitor.

Steps to Create URL Monitoring Service in Nodejs and Expressjs

Step 1: Create a project directory:

mkdir url-monitoring
cd url-monitoring-app

Step 2: Initialize Node.js project:

npm init -y

Step 3: Install dependencies:

npm install express axios body-parser cors request

Project Structure:

👁 file
Project Structure

The updated dependencies in package.json file will lo:

"dependencies": {
"axios": "^1.6.7",
"cors": "^2.8.5",
"express": "^4.18.2",
"request": "^2.88.2"
}

Example: Below is the code example of the URL Monitoring Service:

Steps to Run the App:

node index.js

Output:
👁 GIFRecording

Comment

Explore