Server Health Check Using Pure NodeJS

Server Health Check Using Pure NodeJS

It’s been a month since i have been learning NodeJS and from past one week I have been making a server health check using pure NodeJS (Without NPM) !

Github link : Click here to see the GitHub repo

I have used callback pattern to implement it 🤨

What does it do 🧐 ?

In short it just pings the server and get the status and notifies the user in case of any change in the status code. Here is how its done.


Users
Each users can have max 5 checks and in case of any change in status code users can be notified using twillio sms API.


Tokens
Creation of session tokens for the users when they login
It can be used to:

  • Update, delete user.
  • Add, update, delete checks.
  • Extend token validity.


Checks
Each check consist of:

  • Website URL
  • Protocol (http/https)
  • Required status code
  • Method
  • Timeout Seconds


All the data is stored locally in json form and time period can be set for compressing the logs