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.
MASTER_BEARER to some secure code. You can use
openssl rand -base64 32 to generate a cryptographically random one. Make sure to save it.backend/app.ts and choosing a
new domain.ROOT_URL environmental variable to that root url.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.
The service exposes RESTful endpoints for programmatic access:
GET /api/index: List all filesPOST /api/index: Upload a new fileGET /api/index/:path: Download a specific fileDELETE /api/index/:path: Delete a file