Cloudflare Workers
which is what we’ll follow through with in this guide. After selecting that cd
into the project and install the Pinata SDK.
.dev.vars
file in the root of the project and put in the following variables:
JWT
from the API key creation in the previous step as well as the Gateway Domain
. The format of the Gateway domain should be mydomain.mypinata.cloud
.
src/index.ts
file paste in the following code:
/
- A home route that just returns Hello Hono!
/presigned_url
- A route that will return a Presigned URL that is only valid for 60 seconds which our client can use to upload// Handle Auth
http://localhost:8787
. While this is running, in a separate terminal window run this curl to test the API endpoint: