dotenv
.env
file where we’re pull 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
.
Now we’ll make two files, index.js
and hello-world.txt
.
hello-world.txt
you can put whatever you’d like such as Hello World!
.
index.js
file.
node index.js
in the terminal. After uploading a file you should get a response that looks like this
cid
you can view the file or fetch the data using your Gateway. Lets make a new file called fetch.js
and put in the following code.