mirror of
https://github.com/ivabus/gui
synced 2025-04-24 14:37:11 +03:00
17 lines
347 B
TypeScript
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;
|