Files
penx/apps/web/lib/addToIpfs.ts
2025-04-27 21:13:40 +08:00

11 lines
275 B
TypeScript

import { IPFS_ADD_URL } from '@penx/constants'
export async function addToIpfs(value: string) {
const res = await fetch(IPFS_ADD_URL, {
method: 'POST',
body: value,
headers: { 'Content-Type': 'application/json' },
}).then((d) => d.json())
return res.cid
}