A simple web application that provides a password-protected interface for managing key/value pairs with both web UI and JSON API access.
Set these environment variables in your Val Town settings:
READ_PASSWORD - Password required to view the web interface and access the JSON API (default: "read123")WRITE_PASSWORD - Password required to update values via the form (default: "write123")READ_PASSWORD to access the interfaceage and status in the tableWRITE_PASSWORDAccess the values programmatically:
curl -H "Authorization: Bearer YOUR_READ_PASSWORD" https://your-val-url.web.val.run/api/values
Response format:
{ "age": "25", "status": "active" }
GET / - Main web interface (requires password query parameter)POST /update - Update values via form submission (requires write password)GET /api/values - JSON API endpoint (requires Bearer token authentication)The application initializes with:
age: "25"status: "active"