UNPKG

@topgroup/diginext

Version:

A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.

22 lines (21 loc) 831 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getServerInfo = void 0; const axios_1 = __importDefault(require("axios")); const config_1 = require("../../config/config"); async function getServerInfo() { var _a; try { const { buildServerUrl } = (0, config_1.getCliConfig)(); const response = await axios_1.default.get(`${buildServerUrl}/api/v1/stats/version`); return (_a = response.data) === null || _a === void 0 ? void 0 : _a.data; } catch (e) { console.error(`Unable to get server info: ${e}`); return { version: "Unknown", location: "Unknown" }; } } exports.getServerInfo = getServerInfo;