- Deploy cid-binary-resolver to Cloudflare
- Make a base64 string from the file.
PUT
the base64 strings to ixo-cid-binary-resolver.- Image binary will converted to a data based base64 representation of the CID.
User => Image => base64 => cid-binary-resolver => CID
- Cloudflare Account
- Wrangler CLI (v2)
- Custom domain (* Cache API is not available in
*.workers.dev
domain)
========================
Copy wrangler.example.toml
to wrangler.toml
:
cp wrangler.example.toml wrangler.toml
Edit wrangler.toml
.
Develop
yarn dev
Test
yarn test
Deploy
yarn deploy
Prebuild
yarn build
Body: Base64 string of image binary.
{
"body": "Base64 Text..."
}
- Grab any file .
- Upload to getcid endpoint.
echo '{"body" : "'"$( cat /tmp/1.jpg | base64)"'"}' | curl -XPUT -H "Content-Type: application/json" -d @- https://cid-binary-resolver.ixo-api.workers.dev/getcid -vvv
Andrew Margetts https://github.com/demondayza
MIT