Skip to content

Commit

Permalink
fix: store directory example
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Dec 21, 2021
1 parent 52cd012 commit cfd5dba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/client/examples/browser/storeDirectory.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

const token =
new URLSearchParams(window.location.search).get('key') || 'API_KEY' // your API key from https://nft.storage/manage

function log(msg) {
msg = JSON.stringify(msg, null, 2)
document.getElementById('out').innerHTML += `${msg}\n`
Expand All @@ -22,7 +21,7 @@
const fileEl = document.querySelector('input[type="file"]')
if (!fileEl.files.length) return log('No files selected')
log(`Storing ${fileEl.files.length} files...`)
const store = new NFTStorage({ endpoint, token })
const store = new NFTStorage({ token })
const cid = await store.storeDirectory(fileEl.files)
log({ files: Array.from(fileEl.files).map((f) => f.name), cid })
const status = await store.status(cid)
Expand Down

0 comments on commit cfd5dba

Please sign in to comment.