Skip to content

Find Server module to find server with least priority if available

Notifications You must be signed in to change notification settings

abhishekwebcode/abhishekwebcode_find_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Abhishek Mathur's find_server module👋

Version License: MIT Twitter: abhishekwebcode

A module to find the server with lowest priority

Install

npm install abhishekwebcode_find_server 

Usage

Just require library from npm or your cloned repository and run it
the module contains a findServer method which you can run
to find the least priority server having status code between 200 & 299
const findServer = require('abhishekwebcode_find_server');
const result = await findServer.findServer(myServerArray);

Here the myServerArray is an array of input to library

It has the format

{
    url: "<url of the server>",
    priority: "<priority of the server>"
}

This library returns a promise

Resolves with the server if found

Rejects with an error if list is empty or no server is found to be available

Run tests

npm run test

Author

👤 Abhishek Mathur [email protected]

About

Find Server module to find server with least priority if available

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published