Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Commit ca8cb14

Browse files
committed
Bug fix for demo
1 parent 192e20f commit ca8cb14

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

lib/zero.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export declare class DgraphZero {
33
private readonly addr;
44
constructor(addr?: string);
55
getState(): Promise<Response>;
6+
getClusterHealth(): Promise<Response>;
67
private callAPI;
78
private getURL;
89
}

lib/zero.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ var DgraphZero = (function () {
4949
DgraphZero.prototype.getState = function () {
5050
return this.callAPI("state", {});
5151
};
52+
DgraphZero.prototype.getClusterHealth = function () {
53+
return this.callAPI("health?all", {});
54+
};
5255
DgraphZero.prototype.callAPI = function (path, config) {
5356
return __awaiter(this, void 0, void 0, function () {
5457
var url;

src/zero.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export class DgraphZero {
2626
return this.callAPI("state", {});
2727
}
2828

29+
getClusterHealth() : Promise<Response> {
30+
return this.callAPI("health?all", {});
31+
}
32+
2933
private async callAPI<T>(path: string, config: { method?: string; body?: string; headers?: { [k: string]: string } }): Promise<T> {
3034
const url = this.getURL(path);
3135

0 commit comments

Comments
 (0)