gf
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.
A ChatGPT-like interface using xAI's Grok API.
- Real-time chat interface
- Message history
- Streaming responses
- Clean, modern UI with TailwindCSS
- Responsive design
- Set the environment variable
XAI_API_KEYwith your xAI API key - Deploy the backend as an HTTP val
- Access the chat interface at the root URL
backend/index.ts- Main Hono server with API routesfrontend/index.html- Chat interfacefrontend/app.js- Frontend JavaScript logicfrontend/style.css- Custom styles
GET /- Serves the chat interfacePOST /api/chat- Handles chat messages and returns Grok responses