7 lines
199 B
TypeScript
7 lines
199 B
TypeScript
export const BASE_API_URL = 'http://localhost:8080/';
|
|
|
|
export async function fetcher(url: string) {
|
|
const u = new URL(url, BASE_API_URL);
|
|
const res = await fetch(u);
|
|
return res.json();
|
|
}
|