blob: 645fc2315e360d14036dcaed6063cd9975f8baf3 (
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
});
}
|