diff options
| author | Haishan <[email protected]> | 2019-12-26 18:16:40 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2019-12-26 18:16:40 +0800 |
| commit | b033b4825dfeb2e3a15bae298856d5001310a487 (patch) | |
| tree | 51714bcaa02d65abb7dc89527a83f6f9e50103dc /src/api | |
| parent | 62b7f7f7ba6cafe72222dd3005a16278115be0a8 (diff) | |
feat: can healthcheck a provider
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/proxies.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/api/proxies.js b/src/api/proxies.js index 3ffb275..5bedf31 100644 --- a/src/api/proxies.js +++ b/src/api/proxies.js @@ -53,9 +53,15 @@ export async function fetchProviderProxies(config) { export async function updateProviderByName(config, name) { const { url, init } = getURLAndInit(config); - const options = { - ...init, - method: 'PUT' - }; + const options = { ...init, method: 'PUT' }; return await fetch(url + '/providers/proxies/' + name, options); } + +export async function healthcheckProviderByName(config, name) { + const { url, init } = getURLAndInit(config); + const options = { ...init, method: 'GET' }; + return await fetch( + url + '/providers/proxies/' + name + '/healthcheck', + options + ); +} |
