add project

This commit is contained in:
ZOMBIIIIIII
2026-04-08 14:11:27 +03:00
parent bfa95223a0
commit a81e29807c
115 changed files with 18413 additions and 0 deletions

28
apps/web/src/lib/api.ts Normal file
View File

@@ -0,0 +1,28 @@
import { webEnv } from './env';
const API_URL = webEnv.apiUrl;
async function request<T>(path: string, options: RequestInit = {}): Promise<T> {
const headers: Record<string, string> = {
'Content-Type': 'application/json',
...(options.headers as Record<string, string>),
};
const res = await fetch(`${API_URL}${path}`, {
...options,
headers,
credentials: 'include',
});
const data = await res.json();
if (!data.success) {
throw new Error(data.error || 'Request failed');
}
return data.data;
}
export const api = {
getWallets: () => request<any>('/api/wallets'),
};