| 1234567891011121314151617181920 |
- import axios from "axios";
- import { apiClient } from "./client";
- import { mockHealth, mockMode } from "./mock";
- import type { GatewayServicesHealth, ServiceHealth } from "@/types";
- export async function getHealth(apiKey?: string, userId?: string) {
- if (mockMode) return mockHealth();
- const { data } = await axios.get<ServiceHealth>("/health", {
- headers: {
- ...(apiKey ? { "x-api-key": apiKey } : {}),
- ...(userId ? { "x-user-id": userId } : {}),
- },
- });
- return data;
- }
- export async function getServicesHealth() {
- const { data } = await apiClient.get<GatewayServicesHealth>("/services/health");
- return data;
- }
|