branch backend + ajout du serveur backend, next, et sqlite
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export const API_BASE_URL = 'http://127.0.0.1:3000';
|
||||
|
||||
export async function fetchApi(endpoint: string) {
|
||||
const res = await fetch(`${API_BASE_URL}${endpoint}`, {
|
||||
cache: 'no-store',
|
||||
});
|
||||
if (!res.ok) {
|
||||
throw new Error(`Failed to fetch ${endpoint}`);
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
Reference in New Issue
Block a user