Public
Like
glimpse2-runbook-view-glimpse-save-login
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: v2View latest version
Business logic coordination between routes and services.
Controllers should:
- Handle business logic and orchestration between services
- Handle environment variables and configuration
- Coordinate multiple service calls
- Implement business rules and validation
- Handle service business logic layer (result.success)
The handleUrlWebhook
function follows the webhook handler pattern:
- Takes Hono Context as parameter
- Returns HTTP responses directly
- Handles webhook payload parsing and validation
- Implements business logic for URL updates
- Provides comprehensive logging and error handling
The glimpseHandler
function follows the data API pattern:
- Takes Hono Context as parameter
- Returns JSON data responses
- Filters and transforms service data
- Handles error responses with appropriate status codes
The glimpseLoginHandler
function follows the authentication redirect pattern:
- Extracts user context from authentication middleware
- Queries user database for personalized data
- Implements multi-scenario error handling:
- HTML responses for user-facing errors (access denied)
- JSON responses for technical/debugging errors
- Validates and redirects to user-specific URLs
- Provides comprehensive debugging information for database structure issues
The glimpseThanksHandler
function follows the welcome page pattern:
- Shows user-friendly confirmation pages
- Provides clear next steps and expectations
- Maintains consistent styling with other authentication pages
- Handles edge cases (unauthenticated access) gracefully