Football
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: v28View latest version
The backend is built with Hono and provides:
GET /- Serves the main application with server-side data injectionGET /api/matches- Returns today's football matches in JSON formatGET /frontend/*- Serves frontend static filesGET /shared/*- Serves shared utility files
- Server-side data injection for faster initial load
- Mock football data (can be replaced with real API)
- CORS handling (automatic in Val Town)
- Error handling with full stack traces
- Static file serving using Val Town utilities
Currently uses mock data that simulates real football matches. To integrate with a real API:
- Replace the
fetchTodaysMatches()function - Use a service like football-data.org, API-Football, or similar
- Add environment variables for API keys if needed
The current implementation includes:
- Live matches with scores and minute updates
- Scheduled matches with kickoff times
- Finished matches with final scores
- Multiple competitions (Premier League, La Liga, etc.)