This app shows off some quick and dirty uses of presigned URLS on Tigris.
Install Go and then run go mod download
to download all of the dependencies.
Head to storage.new and make a new bucket, named something like example-presigned
.
Click on the Access Keys tab in the sidebar and then click on Create New Access Key. Give it a descriptive name and grant it editor access to the bucket you just created.
Copy the environment variables to .env
.
Run go run
to start the app:
go run --bucket-name=example-presigned
It'll start listening on localhost:9090, and then upload an image. You'll be redirected to a page like this:
This page has a pre-signed GET url that is good for 6 hours. It also has a pre-signed DELETE url so you can delete the image if you don't want to keep it around.