Recipes¶
Copy-paste solutions for common tasks. Each links to the relevant guide.
Share this folder with the phone in my hand¶
Binds the LAN with a self-signed cert and prints a QR code to scan. → Sharing on a LAN
Let someone drop files to me (securely)¶
servery --upload --auth me:secret --tls-self-signed --bind 0.0.0.0
# or the preset:
servery --profile inbox --auth me:secret --qr
Mount the share as a drive in Finder/Explorer¶
# read-only:
servery --dav --bind 0.0.0.0
# read/write, with a password:
servery --dav --dav-write --auth me:secret --bind 0.0.0.0
→ WebDAV
Get a real, browser-trusted HTTPS certificate automatically¶
sudo servery --acme example.com --acme-email you@example.com \
--acme-production --bind 0.0.0.0 --port 443
Needs the domain pointed at you and port 80 reachable for the challenge. → HTTPS & certificates
Serve a built front-end (SPA) with client-side routing¶
Serve static assets as a CDN-style origin¶
→ Compression, caching & headers
Download a whole folder in one click¶
Append to any directory URL:
Or tick a few files and hit zip selected. → Serving files
Read the docs folder in the browser instead of downloading it¶
Every file gets a 🔍 link: Markdown renders as HTML, source is
syntax-highlighted, CSV becomes a table. ?preview=source reads any of them raw.
→ Preview & metadata
Find the note I wrote — I only remember the author¶
Then browse to ?meta=author:lovelace, or sort the new Title/Author column. To
script it instead of clicking:
curl -s 'http://localhost:8000/?metadata=1' |
jq -r '.entries[] | select(.metadata.author? // "" | test("lovelace"; "i")) | .path'
Run a local API behind the same origin as my files¶
Keep an access log for analytics¶
Use it in a test (ephemeral port, background thread)¶
import threading
from servery import Config, make_server, server_url
server = make_server(Config.create("./fixtures", port=0))
threading.Thread(target=server.serve_forever, daemon=True).start()
base = server_url(server) # http://127.0.0.1:<random>/
# … make requests against base …
server.shutdown()