UNPKG

phx-react

Version:

PHX REACT

30 lines 1.27 kB
import { __awaiter, __generator } from "tslib"; import { getEnv } from '../../read-env-config'; import axios from 'axios'; export default function PHXGetEnvPublicV3() { return __awaiter(this, void 0, void 0, function () { var urlApiGateway, response, error_1; return __generator(this, function (_a) { switch (_a.label) { case 0: urlApiGateway = getEnv('NEXT_PUBLIC_API_GATEWAY', process.env.NEXT_PUBLIC_API_GATEWAY); _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); return [4 /*yield*/, axios.get("".concat(urlApiGateway, "/public-setting/settings/env-public"), { headers: { 'Content-Type': 'application/json' } })]; case 2: response = _a.sent(); return [2 /*return*/, response.data]; case 3: error_1 = _a.sent(); throw new Error('Error with Axios request: ' + error_1.message); case 4: return [2 /*return*/]; } }); }); } //# sourceMappingURL=getEnvPublic.js.map