https://github.com/venndev/vb-request
This is simple the package used to balance the volume of requests from clients for your software.
https://github.com/venndev/vb-request
Last synced: 4 months ago
JSON representation
This is simple the package used to balance the volume of requests from clients for your software.
- Host: GitHub
- URL: https://github.com/venndev/vb-request
- Owner: VennDev
- License: apache-2.0
- Created: 2024-03-29T18:33:39.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-30T04:47:55.000Z (about 2 years ago)
- Last Synced: 2024-12-30T18:19:48.137Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Info
- This is the package used to balance the volume of requests from clients for your software.
- Install package: ```npm i vb-request```
# Example
```js
const vbrequest = require('vb-request');
const test = async () =>
{
const response = await vbrequest.get('servers1', '/')
console.log(response);
}
test();
const test2 = async () =>
{
const response = await vbrequest.get('servers2', '/controllerName/methodName', {
Headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer %token%'
},
Query: {
'param1': 'value1',
'param2': 'value2'
},
})
console.log(response);
}
test2();
```
# Config
```yml
groups:
servers1:
server-choosing: 2
servers:
'1':
url: http://google.com
token: token
'2':
url: http://localhost:3001
token: token
servers2:
server-choosing: 1
servers:
'1':
url: http://localhost:3000
token: token
'2':
url: http://localhost:3001
token: token
```
# Why?