The backend is built with Hono and provides a RESTful API for publishing and retrieving HTML websites.
CREATE TABLE website_pages_v1 (
id INTEGER PRIMARY KEY AUTOINCREMENT,
key TEXT UNIQUE NOT NULL,
password_hash TEXT,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL,
size INTEGER NOT NULL,
is_public INTEGER DEFAULT 1
);
key (required): Website identifierpassword (optional): For protection or authenticationformat (optional): Response formatdata field)The backend provides comprehensive error handling with appropriate HTTP status codes:
400 Bad Request: Invalid input, missing data, or validation errors401 Unauthorized: Password required or invalid password413 Payload Too Large: Content exceeds 10MB limit500 Internal Server Error: Database or storage errors_v1) for schema changesinitDatabase() on startup to create tables"salt_valtowngeocities"Use the provided curl examples in the main README to test functionality:
# Test basic publishing curl -X POST "https://your-val-url.web.val.run/?key=test" \ -H "Content-Type: text/html" \ -d "<html><body><h1>Test</h1></body></html>" # Test password protection curl -X POST "https://your-val-url.web.val.run/?key=protected&password=test123" \ -H "Content-Type: text/html" \ -d "<html><body><h1>Protected</h1></body></html>"