Skip to content

Thư viện từ cá nhân github tôi fork về để custom riêng cho dự án này!

License

Notifications You must be signed in to change notification settings

Nhom7-CNPM3/vb-request

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Info

  • This is the package used to balance the volume of requests from clients for your software.
  • Install package: npm i vb-request

Example

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

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?

About

Thư viện từ cá nhân github tôi fork về để custom riêng cho dự án này!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%