dad-joke-generator
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.
server.tsx
https://willemhelmet--0199baef30cb751cae2f86f51420c2fc.web.val.run
A simple, cheerful web app that generates cheesy dad jokes using OpenAI's API.
- π€ AI-powered dad joke generation via OpenAI
- π¨ Clean, responsive design with TailwindCSS
- β‘ Fast and lightweight with Hono backend
- π One-click joke generation
The app consists of:
Backend (backend/index.ts):
- Hono server handling HTTP requests
/api/jokeendpoint that calls OpenAI to generate dad jokes- Static file serving for frontend assets
Frontend (frontend/):
- Simple HTML interface with a joke display and generate button
- TypeScript client-side logic for fetching jokes
- Responsive styling with TailwindCSS
Deploy backend/index.ts as an HTTP val on Val Town. The OpenAI integration is automatically configured using Val Town's standard library.
- Click the "Generate Dad Joke" button
- Wait for the AI to generate a fresh dad joke
- Laugh (or groan) at the cheesy humor
- Repeat as needed!