jbilcke-hf HF Staff commited on
Commit
cb19688
·
1 Parent(s): 2ec3431
Files changed (1) hide show
  1. src/server/base.ts +1 -4
src/server/base.ts CHANGED
@@ -5,7 +5,6 @@ const apiUrl = process.env.VC_VIDEOCHAIN_API_URL
5
 
6
  export const get = async <T>(path: string = '', defaultValue: T): Promise<T> => {
7
  try {
8
- console.log("fetching:", `${apiUrl}/${path} with Bearer ${process.env.VC_SECRET_ACCESS_TOKEN}`)
9
  const res = await fetch(`${apiUrl}/${path}`, {
10
  method: "GET",
11
  headers: {
@@ -16,7 +15,7 @@ export const get = async <T>(path: string = '', defaultValue: T): Promise<T> =>
16
  // we can also use this (see https://vercel.com/blog/vercel-cache-api-nextjs-cache)
17
  // next: { revalidate: 10 }
18
  })
19
- console.log("res:", res)
20
  // The return value is *not* serialized
21
  // You can return Date, Map, Set, etc.
22
 
@@ -28,7 +27,6 @@ export const get = async <T>(path: string = '', defaultValue: T): Promise<T> =>
28
 
29
  const data = await res.json()
30
 
31
- console.log("data:", data)
32
  return ((data as T) || defaultValue)
33
  } catch (err) {
34
  console.error(err)
@@ -64,7 +62,6 @@ export const post = async <S, T>(path: string = '', payload: S, defaultValue: T)
64
 
65
  return ((data as T) || defaultValue)
66
  } catch (err) {
67
- console.error(err)
68
  return defaultValue
69
  }
70
  }
 
5
 
6
  export const get = async <T>(path: string = '', defaultValue: T): Promise<T> => {
7
  try {
 
8
  const res = await fetch(`${apiUrl}/${path}`, {
9
  method: "GET",
10
  headers: {
 
15
  // we can also use this (see https://vercel.com/blog/vercel-cache-api-nextjs-cache)
16
  // next: { revalidate: 10 }
17
  })
18
+
19
  // The return value is *not* serialized
20
  // You can return Date, Map, Set, etc.
21
 
 
27
 
28
  const data = await res.json()
29
 
 
30
  return ((data as T) || defaultValue)
31
  } catch (err) {
32
  console.error(err)
 
62
 
63
  return ((data as T) || defaultValue)
64
  } catch (err) {
 
65
  return defaultValue
66
  }
67
  }