Socket
Socket
Sign inDemoInstall

onedionys-load-balancer-middleware

Package Overview
Dependencies
132
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    onedionys-load-balancer-middleware

One Dionys (Load Balancer Middleware) - Middleware to distribute traffic evenly across multiple backend servers, improving application scalability and availability.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Welcome to One Dionys - Load Balancer Middleware! 👋

Middleware to distribute traffic evenly across multiple backend servers, improving application scalability and availability. 💖

💾 Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

🎯 How To Use

Example Syntax
const express = require('express');
const loadBalancerMiddleware = require('./src/loadBalancerMiddleware');

const app = express();

const servers = [
    { url: 'http://server1.com', weight: 1 },
    { url: 'http://server2.com', weight: 2 },
    // Add more servers as needed
];

app.use(loadBalancerMiddleware(servers));

// Add your routes and other middleware here

app.listen(3000, () => {
    console.log('Server is running on port 3000');
});
Explanation
  • This middleware implements a basic load balancing algorithm to distribute incoming requests among multiple servers. It takes an array of server objects, each containing the server URL and its weight. The middleware then routes requests to the servers based on their weights.
Return Value
  • The middleware function returns an Express middleware function that can be used in an Express application. This middleware should be placed early in the middleware stack to ensure that all requests are properly load balanced before reaching other middleware or route handlers.

📆 Release Date

  • v1.0.0 : 17 March 2024
  • v1.0.1 : 18 March 2024
  • v1.0.2 : 31 March 2024
  • v5.0.0 : 31 March 2024

🧑 Author

  • Facebook : Oned Ionys
  • Instagram : @onedionys
  • Twitter : @onedionys
  • LinkedIn : @onedionys

📝 License

  • Copyright © 2024 One Dionys
  • One Dionys - Load Balancer Middleware is an open source project licensed under the MIT license

☕️ Suppport & Donation

Love One Dionys - Load Balancer Middleware? Support this project by donating or sharing with others in need.

Made with ❤️ One Dionys

Keywords

FAQs

Last updated on 31 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc