Skip to content

Commit 210716b

Browse files
authored
example: misc fixes (#77)
1 parent e383cd0 commit 210716b

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

example/src/api.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { utils } from 'ethers'
22
import { MerkleTree } from 'merkletreejs'
33

4-
const baseUrl = 'http://localhost:8080'
4+
const baseUrl = process.env.API_URL ?? 'http://localhost:8080'
55

66
const createTree = async (
77
unhashedLeaves: string[],
@@ -82,7 +82,7 @@ const getProofForIndexedAddress = async (
8282

8383
const getRootFromProof = async (proof: string[]): Promise<string> => {
8484
const rootRes = await fetch(`${baseUrl}/api/v1/root?proof=${proof.join(',')}`)
85-
const resp = await rootRes.json()
85+
const resp: { root: string } = await rootRes.json()
8686
return resp.root
8787
}
8888

@@ -111,19 +111,6 @@ const checkProofEquality = (remote: string[], local: string[]) => {
111111
}
112112
}
113113

114-
// health check
115-
116-
const healthRes = await fetch(`${baseUrl}/health`, {
117-
method: 'GET',
118-
headers: {
119-
'Content-Type': 'application/json',
120-
'Accept-Encoding': 'gzip',
121-
},
122-
})
123-
124-
const version = await healthRes.text()
125-
console.log('api version', version)
126-
127114
// basic merkle tree
128115

129116
const unhashedLeaves = [

0 commit comments

Comments
 (0)