Public
Like
4
Electric
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.
Viewing readonly version of main branch: v8View latest version
A minimalist file storage API built with Hono and Val Town's blob storage.
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
POST /route
Form Parameters:
file: The file to uploadfilename: 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 /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"
GET /route
Example:
curl -X GET https://your-val.web.val.run/route \ -H "Authorization: Bearer your-secret-token"
DELETE /
Example:
curl -X DELETE https://your-val.web.val.run/ \ -H "Authorization: Bearer your-secret-token"
All files are stored in Val Town's blob storage with the prefix vt-docs/ to ensure safety and organization.
- The DELETE endpoint only removes files with the
vt-docs/prefix - Authentication is required for all operations
- Error handling provides clear feedback