https://github.com/switcherapi/switcher-load-balance
Switcher Load Balance - Load balancing API
https://github.com/switcherapi/switcher-load-balance
load-balancer
Last synced: 12 months ago
JSON representation
Switcher Load Balance - Load balancing API
- Host: GitHub
- URL: https://github.com/switcherapi/switcher-load-balance
- Owner: switcherapi
- License: mit
- Created: 2020-02-16T02:00:09.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-16T19:01:05.000Z (about 3 years ago)
- Last Synced: 2025-02-06T05:14:42.200Z (about 1 year ago)
- Topics: load-balancer
- Language: JavaScript
- Homepage:
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
***
Switcher Load Balancer
Simple load balancer to orquestrate endpoint availability
[](https://github.com/switcherapi/switcher-load-balance/actions/workflows/master.yml)
[](https://sonarcloud.io/dashboard?id=switcherapi_switcher-load-balance)
[](https://snyk.io/test/github/switcherapi/switcher-load-balance)
[](https://opensource.org/licenses/MIT)
[](https://switcher-hq.slack.com/)
***

# 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.
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9FKW64V67RKXW&source=url)