Public
Like
my-first-val
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: v14View latest version
Hono-based API server providing real-time chat functionality for travel planning.
index.ts- Main Hono application with HTTP endpointsdatabase/migrations.ts- SQLite table setupdatabase/queries.ts- Database query functions
GET /- Serves the chat interface with initial message dataGET /api/messages- Returns recent messages (JSON)POST /api/messages- Creates new message (JSON)GET /api/messages/stream- Server-sent events for real-time updatesGET /frontend/*- Serves frontend static filesGET /shared/*- Serves shared utility files
CREATE TABLE travel_chat_messages_1 (
id INTEGER PRIMARY KEY AUTOINCREMENT,
author TEXT NOT NULL,
content TEXT NOT NULL,
timestamp TEXT NOT NULL,
created_at INTEGER NOT NULL
);
Uses Server-Sent Events (SSE) to push new messages to connected clients every 2 seconds.