• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
thesolarmonk

thesolarmonk

lace-blobs-server-dev

Public
Like
lace-blobs-server-dev
Home
Code
2
backend
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
4
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://thesolarmonk--836cdc8a6d7611f09a2a0224a6c84d84.web.val.run
README.md

S3 Proxy API

A simple S3 proxy service that generates signed URLs for uploading and downloading files from AWS S3.

Setup

Environment Variables

You need to set the following environment variables in your Val Town settings:

  • AWS_ACCESS_KEY_ID - Your AWS access key ID
  • AWS_SECRET_ACCESS_KEY - Your AWS secret access key
  • AWS_S3_BUCKET - The S3 bucket name to use
  • AWS_REGION - AWS region (optional, defaults to us-east-1)

AWS IAM Permissions

Your AWS credentials need the following S3 permissions:

  • s3:GetObject
  • s3:PutObject

API Endpoints

POST /upload

Generate a signed URL for uploading a file to S3.

Request:

{ "objectId": "my-file.jpg" }

Response:

{ "signedUrl": "https://bucket.s3.amazonaws.com/my-file.jpg?...", "objectId": "my-file.jpg", "expiresIn": 3600 }

POST /download

Generate a signed URL for downloading a file from S3.

Request:

{ "objectId": "my-file.jpg" }

Response:

{ "signedUrl": "https://bucket.s3.amazonaws.com/my-file.jpg?...", "objectId": "my-file.jpg", "expiresIn": 3600 }

Usage Examples

Upload a file

  1. Call /upload with the desired object ID
  2. Use the returned signed URL to PUT your file directly to S3
  3. The signed URL expires in 60 minutes

Download a file

  1. Call /download with the object ID
  2. Use the returned signed URL to GET the file directly from S3
  3. The signed URL expires in 60 minutes

Error Handling

The API returns appropriate HTTP status codes:

  • 200 - Success
  • 400 - Bad request (missing objectId)
  • 500 - Server error (missing config, AWS errors)
HTTP
  • index.ts
    thesolarmonk--83…84.web.val.run
Code
backendREADME.md
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.