Skip to content

switcherapi/switcher-load-balance

Repository files navigation


Switcher Load Balancer
Simple load balancer to orquestrate endpoint availability

Master CI Quality Gate Status Known Vulnerabilities License: MIT Slack: Switcher-HQ


Switcher Load Balance: Load Balancing API

Requirements

  • NodeJS
  • Postman (optional for request examples)
  • Coffee =D

About

Switcher Load Balance is a simple load balance developed especially for supporting CI environments.

Main features:

  • Auto switch off when a node is offline.
  • Auto recover, forced or scheduled.
  • Stateful configuration, no DB in between, the only latency is the network.
  • Check node health via REST requests.
  • API Key generated automatically after deployment.

Configuration

  1. npm install
  2. Add .env-cmdrc file into the project directory.

Example:

{
  "dev": {
    "PORT": "3002",
    "SNODE1": "http://localhost:3000",
    "SNODE2": "https://switcherapi.com/api",
    "CHECK_ENDPOINT": "/check",
    "LOGGER": "true",
    "RECOVER_ATTEMPT_DURATION": "60",
    "RECOVER_INTERVAL": "10"
  },
  "prod": {
    "PORT": "3002",
    "SNODE1": "http://localhost:3000",
    "SNODE2": "https://switcherapi.com/api",
    "CHECK_ENDPOINT": "/check",
    "LOGGER": "true",
    "RECOVER_ATTEMPT_DURATION": "60",
    "RECOVER_INTERVAL": "10"
  },
  "test": {
    "PORT": "3002"
  }
}

Donation

Donations for cookies and pizza are extremely welcomed.

paypal

About

Switcher Load Balance - Load balancing API

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks