Add environment variable for API URL; update TypeScript configuration to include vite-env; refactor API client to use environment variable; modify timestamp fields in database schemas to include timezone support

This commit is contained in:
2025-10-06 13:00:32 +05:00
parent 0b024af454
commit 9e4bc7b0f8
10 changed files with 50 additions and 13 deletions
+2 -1
View File
@@ -2,7 +2,7 @@ import ky from "ky";
// Базовый API клиент
export const api = ky.create({
prefixUrl: "http://localhost:3000",
prefixUrl: import.meta.env.VITE_API_URL,
headers: {
"Content-Type": "application/json",
},
@@ -11,6 +11,7 @@ export const api = ky.create({
(request) => {
// Автоматически добавляем токен из localStorage если есть
const token = localStorage.getItem("authToken");
if (token) {
request.headers.set("Authorization", `Bearer ${token}`);
}