Skip to content

Commit

Permalink
example: misc fixes (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
malonehedges authored Sep 14, 2022
1 parent e383cd0 commit 210716b
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions example/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { utils } from 'ethers'
import { MerkleTree } from 'merkletreejs'

const baseUrl = 'http://localhost:8080'
const baseUrl = process.env.API_URL ?? 'http://localhost:8080'

const createTree = async (
unhashedLeaves: string[],
Expand Down Expand Up @@ -82,7 +82,7 @@ const getProofForIndexedAddress = async (

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

Expand Down Expand Up @@ -111,19 +111,6 @@ const checkProofEquality = (remote: string[], local: string[]) => {
}
}

// health check

const healthRes = await fetch(`${baseUrl}/health`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept-Encoding': 'gzip',
},
})

const version = await healthRes.text()
console.log('api version', version)

// basic merkle tree

const unhashedLeaves = [
Expand Down

1 comment on commit 210716b

@vercel
Copy link

@vercel vercel bot commented on 210716b Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lanyard – ./

lanyard-git-main.context.wtf
lanyard.context.wtf
allowlist.context.wtf

Please sign in to comment.