aboutsummaryrefslogtreecommitdiff
path: root/src/lib/api.ts
blob: 221a7b33e7351401935fe3d1c316ebab31b7bfc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
  });
}