codex plugin cleanup

This commit is contained in:
Eric 2024-06-17 17:27:15 +10:00
parent 342eba171c
commit 3fb5a59069
No known key found for this signature in database

View File

@ -1,19 +1,9 @@
export default { export default {
install: (app, { codexRestUrl, myAddress }) => { install: (app, { codexRestUrl, myAddress }) => {
// const baseUrl = new URL(codexRestUrl)
const options = {
mode: 'cors'
}
const codexApi = { const codexApi = {
info: () => { info: () => fetch(`${codexRestUrl}/debug/info`),
return fetch(`${codexRestUrl}/debug/info`, options) download: (cid) => fetch(`${codexRestUrl}/data/${cid}/network`),
}, downloadLocal: (cid) => fetch(`${codexRestUrl}/data/${cid}`)
download: (cid) => {
return fetch(`${codexRestUrl}/data/${cid}/network`, options)
},
downloadLocal: (cid) => {
return fetch(`${codexRestUrl}/data/${cid}`, options)
}
} }
app.provide('myAddress', myAddress) app.provide('myAddress', myAddress)