gui/modules/desktop/electron/libs/v1Client.ts
2023-02-14 14:31:06 +08:00

17 lines
347 B
TypeScript

import axios from "axios";
import path from "path";
const base = "https://api.tea.xyz";
export async function get<T>(urlPath: string) {
const url = new URL(path.join("v1", urlPath), base).toString();
// TODO: add headers
const req = await axios.request<T>({
method: "GET",
url,
headers: {}
});
return req.data;
}
export default get;