Public
Like
flipdot
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: v29View latest version
# Run the local dev server deno task dev # Or with custom API key FLIPDOT_API_KEY=my-secret-key deno task dev
The server will start on http://localhost:8000
- Local: Uses
./.local-storage/directory (automatically created) - Production: Uses Val Town blob storage
- Detection: Checks for
DENO_DEPLOYMENT_IDenvironment variable
curl http://localhost:8000/health
# Default local dev key curl -H "X-API-Key: local-dev-key" http://localhost:8000/api/flipdot/content # Or with Bearer token curl -H "Authorization: Bearer local-dev-key" http://localhost:8000/api/flipdot/content
{ "status": "updated", "content": { "content_id": "clock:simple5x7:14:30", "frames": [{ "data_b64": "...", "width": 28, "height": 14, "duration_ms": null }], "playback": { "priority": 10, "interruptible": true, "loop": false }, "metadata": { "type": "clock", "time": "14:30", "timestamp": "2025-11-05T14:30:00.000Z" } }, "poll_interval_ms": 30000 }
{ "status": "no_change", "poll_interval_ms": 30000 }
# View all cached files ls -la .local-storage/ # View a specific cache entry cat .local-storage/flipdot_source_clock.json # Clear all cache rm -rf .local-storage/
flipdot:source:clock- Clock content cache (60s TTL)flipdot:source:text:{hash}- Text content cache (5min TTL)flipdot:last_content_id- Last sent content ID
- Watch mode: Use
deno task dev --watchto auto-reload on file changes - Custom port: Modify
PORTindev.ts - Debug storage: Check
.local-storage/to see what's being cached - Force refresh: Delete cache files to trigger re-generation
When deploying to Val Town:
- Set
FLIPDOT_API_KEYenvironment variable in Val Town settings - Push
backend/index.tsas an HTTP val - The storage wrapper will automatically use Val Town blob storage