The backend is built with Hono and provides:
GET / - Serves the main application with server-side data injection
GET /api/matches - Returns today's football matches in JSON format
GET /frontend/* - Serves frontend static files
GET /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.)