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

wolf

VTDocs

Remix of wolf/Electric
Public
Like
VTDocs
Home
Code
6
backend
3
cli
2
.vtignore
LICENSE.txt
README.md
deno.json
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
app.ts
https://wolf--2355a478f80f47dfa7909b9db90b7b38.web.val.run
README.md

Electric: Static Site hosting on Val Town

Electric is a lightweight static site hosting system built on Hono RPC and Val Town blob store, with a simple CLI. You can use Electric with your favorite static site generator, and add electric upload at the end of your build script.

Features

  • Simple File Management: Upload, download, list, and delete files through a RESTful API
  • Command Line Interface: Easy-to-use CLI for bulk operations with concurrent uploads
  • Authentication: Secure API access with bearer token authentication
  • Caching: Optimized content delivery with configurable cache settings
  • Val Town Integration: Leverages Val Town's blob storage for reliable file hosting

Host your own static site!

  1. Remix this Val by clicking the remix button
  2. Go to environmental variables, and set MASTER_BEARER to some secure code. You can use openssl rand -base64 32 to generate a cryptographically random one. Make sure to save it.
  3. [OPTIONAL] Set a vanity domain for the static site by going to backend/app.ts and choosing a new domain.
  4. Set the ROOT_URL environmental variable to that root url.
  5. Set the STORAGE_PREFIX to something that describes what the static website is. This is where the files will live.

Now, make sure you have Deno installed locally, and then

# Install the CLI tool deno install -grAf -n=electric https://esm.town/v/wolf/Electric/cli/mod.ts # Upload a directory of static files electric upload ./my-site # List your uploaded files electric list

For all CLI commands, run electric --help.

API Endpoints

The service exposes RESTful endpoints for programmatic access:

  • GET /api/index: List all files
  • POST /api/index: Upload a new file
  • GET /api/index/:path: Download a specific file
  • DELETE /api/index/:path: Delete a file
HTTP
  • app.ts
    wolf--2355a478f80f47dfa7909b9db90b7b38.web.val.run
Code
backendcli.vtignoreLICENSE.txtREADME.mddeno.json
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
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.