Backend API

Hono-based API server for the story generator application.

Endpoints

  • GET / - Serves the main application HTML
  • POST /api/generate-story - Generates a new story with chapters and images
  • GET /frontend/* - Serves frontend static files
  • GET /shared/* - Serves shared utility files

Features

  • OpenAI integration for story generation
  • AI image generation for story and chapter visuals
  • Blob storage for caching generated content
  • Error handling and validation

Environment Variables

The app uses OpenAI through Val Town's standard library, which handles API keys automatically.