/ frontend / src / ipfs_service.ts
ipfs_service.ts
 1  class IPFSService {
 2  
 3    async addContent() {
 4      const res = await fetch(
 5        'http://rk-devbox1:3000/ipfs-add/',
 6        {
 7          method: "POST",
 8          body: JSON.stringify(blogData.getJSON())
 9        })
10  
11      const json = await res.json()
12  
13    }
14  
15    async getContent(cid: string) {
16      return fetch('http://rk-devbox1:3000/ipfs-get/' + cid)
17    }
18  }
19  
20  export { IPFSService }