• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
wolf

wolf

Electric

Static site hosting on Val Town
Remix of std/reactHonoStarter
Public
Like
4
Electric
Home
Code
4
backend
frontend
1
README.md
H
index.ts
Branches
1
Pull requests
Remixes
1
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
/
README.md
Code
/
README.md
Search
5/2/2025
Viewing readonly version of main branch: v8
View latest version
README.md

Simple File Storage API

A minimalist file storage API built with Hono and Val Town's blob storage.

Authentication

All endpoints require bearer token authentication. Set the MASTER_BEARER environment variable in your Val Town settings.

Include the token in your requests:

Authorization: Bearer your-secret-token

Endpoints

Upload a File

POST /route

Form Parameters:

  • file: The file to upload
  • filename: The name to save the file as

Example:

curl -X POST https://your-val.web.val.run/route \ -H "Authorization: Bearer your-secret-token" \ -F "file=@/path/to/your/file.pdf" \ -F "filename=document.pdf"

Get a File

GET /route?filename=your-filename

Query Parameters:

  • filename: The name of the file to retrieve

Example:

curl -X GET "https://your-val.web.val.run/route?filename=document.pdf" \ -H "Authorization: Bearer your-secret-token"

List All Files

GET /route

Example:

curl -X GET https://your-val.web.val.run/route \ -H "Authorization: Bearer your-secret-token"

Delete All Files

DELETE /

Example:

curl -X DELETE https://your-val.web.val.run/ \ -H "Authorization: Bearer your-secret-token"

Storage Details

All files are stored in Val Town's blob storage with the prefix vt-docs/ to ensure safety and organization.

Safety Features

  • The DELETE endpoint only removes files with the vt-docs/ prefix
  • Authentication is required for all operations
  • Error handling provides clear feedback
FeaturesVersion controlCode intelligenceCLIMCP
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.