1 export function authToken() {
2 return localStorage.getItem('authToken');
6 get: async (path: string) => {
7 const res = await fetch(path, {
9 'x-authtoken': authToken()
14 post: async (path: string, data: any) => {
15 const res = await fetch(path, {
17 body: JSON.stringify(data),
19 'x-authtoken': authToken(),
20 'content-type': 'application/json'