Initial commit

This commit is contained in:
2026-02-27 15:01:06 +03:00
commit fc06bb6fcd
52 changed files with 1355 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
const API_BASE = import.meta.env.VITE_API_BASE || "/api";
async function handleResponse(response) {
if (!response.ok) {
const errorText = await response.text();
throw new Error(errorText || `Request failed: ${response.status}`);
}
return response.json();
}
export async function apiGet(path) {
const response = await fetch(`${API_BASE}${path}`);
return handleResponse(response);
}