blob: e6ac0f19635b2d97a34148d4e0548948272d2fcf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
const base = 'https://localhost:5001/api'
export async function api(method: string, resource: string, data?: any) {
// console.log("API USED", method, resource, data);
return await fetch(`${base}/${method}/${resource}`, {
method,
headers: {
'content-type': 'application/json'
},
body: data
});
}
|