• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
drewmcdonald

drewmcdonald

flipdot

server for flipdot display content
Public
Like
flipdot
Home
Code
10
.claude
1
backend
5
frontend
4
shared
.vtignore
CLAUDE.md
CONTENT_SERVER_SPEC.md
LOCAL_TESTING.md
deno.json
dev.ts
Branches
1
Pull requests
Remixes
History
Environment variables
3
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
/
LOCAL_TESTING.md
Code
/
LOCAL_TESTING.md
Search
11/8/2025
Viewing readonly version of main branch: v29
View latest version
LOCAL_TESTING.md

Local Testing Guide

Quick Start

# 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

Storage

  • Local: Uses ./.local-storage/ directory (automatically created)
  • Production: Uses Val Town blob storage
  • Detection: Checks for DENO_DEPLOYMENT_ID environment variable

Test Endpoints

Health Check (no auth)

curl http://localhost:8000/health

Get Content (requires auth)

# 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

Expected Response (first call)

{ "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 }

Expected Response (within same minute)

{ "status": "no_change", "poll_interval_ms": 30000 }

Inspecting Local Storage

# 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/

Cache Keys

  • 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

Development Tips

  1. Watch mode: Use deno task dev --watch to auto-reload on file changes
  2. Custom port: Modify PORT in dev.ts
  3. Debug storage: Check .local-storage/ to see what's being cached
  4. Force refresh: Delete cache files to trigger re-generation

Deployment to Val Town

When deploying to Val Town:

  1. Set FLIPDOT_API_KEY environment variable in Val Town settings
  2. Push backend/index.ts as an HTTP val
  3. The storage wrapper will automatically use Val Town blob storage
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.