• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
jamiedubs

jamiedubs

valtownGeocities

Remix of jamiedubs/databin
Public
Like
1
valtownGeocities
Home
Code
5
backend
1
frontend
1
shared
1
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
11/21/2025
Viewing readonly version of main branch: v40
View latest version
README.md

valtownGeocities - Custom Website Publisher

A modernized custom website publisher that allows you to store and serve HTML websites via Val Town. Originally designed to work with Glif for AI-generated websites, but now supports any HTML content!

✨ What's New (Modernized Version)

  • πŸš€ Large HTML Support: Now handles very large HTML files (up to 10MB)
  • πŸ›‘οΈ Better Error Handling: Comprehensive validation and user-friendly error messages
  • πŸ”§ Improved API: RESTful design with proper HTTP status codes
  • πŸ“Š Enhanced Data Storage: Tracks creation/update times and file sizes
  • πŸ”’ Security: Key validation to prevent malicious inputs
  • πŸ”„ Legacy Compatibility: Maintains backward compatibility with existing URLs
  • πŸ› Bug Fixes: Fixed the [object Object] display issue

πŸš€ Quick Start

Basic Usage

Publish a Website

# POST HTML content directly curl -X POST "https://your-val-url.web.val.run/?key=my-site" \ -H "Content-Type: text/html" \ -d "<html><body><h1>Hello World!</h1></body></html>" # POST JSON with HTML (legacy format) curl -X POST "https://your-val-url.web.val.run/?key=my-site" \ -H "Content-Type: application/json" \ -d '{"data": "<html><body><h1>Hello World!</h1></body></html>"}'

View a Website

# View in browser https://your-val-url.web.val.run/?key=my-site # Get JSON response with metadata https://your-val-url.web.val.run/?key=my-site&format=json

πŸ”§ API Reference

MethodURL PatternDescription
GET/?key=<key>View published website
POST/?key=<key>Publish HTML content
GET/?key=<key>&format=jsonGet website data as JSON
GET/Admin interface (when no key provided)

Parameters

  • key (required for publish/view): Website identifier

    • Format: Alphanumeric characters, hyphens, underscores only
    • Max length: 100 characters
    • Examples: my-site, blog_2024, test-page-1
  • format (optional): Response format

    • html (default): Returns rendered HTML
    • json: Returns JSON with metadata

Response Formats

HTML Response (default)

Returns the published HTML with a small footer indicating it's hosted by valtownGeocities.

JSON Response

{ "data": { "html": "<html>...</html>", "createdAt": "2025-11-21T14:56:57.968Z", "updatedAt": "2025-11-21T14:56:57.968Z", "size": 2722 } }

πŸ“ Features

Core Features

  • Large File Support: Handle HTML files up to 10MB
  • Multiple Input Formats: Accept raw HTML or JSON with data field
  • Automatic Processing: Strips common formatting artifacts (like ```html blocks)
  • Metadata Tracking: Automatic creation/update timestamps and size tracking

Security & Validation

  • Key Validation: Secure key format validation prevents injection attacks
  • Size Limits: Prevents abuse with 10MB file size limit
  • Input Sanitization: Processes and cleans HTML input

Developer Experience

  • Better Error Messages: Clear, actionable error responses
  • HTTP Status Codes: Proper REST API status codes (400, 413, 500, etc.)
  • Legacy Support: Backward compatible with existing integrations

πŸ”— Integration with Glif

You can still use this with Glif for AI-generated websites:

  1. Generate: Run a Glif that generates HTML: https://glif.app/@jamiedubs/glifs/clqecfqdd000tc3vk4i208jl3
  2. Publish: The Glif will POST the generated HTML to your valtownGeocities instance
  3. View: Access your website at: https://your-val-url.web.val.run/?key=YOURKEYHERE

πŸ› Bugs Fixed

  • [object Object] Display: Fixed the major bug where websites showed [object Object] instead of actual HTML content
  • Large File Handling: Improved handling of large HTML payloads
  • Error Responses: Better error handling and user feedback
  • JSON Processing: Fixed JSON input parsing issues

πŸ—οΈ Project Structure

β”œβ”€β”€ main.tsx              # Main application (HTTP trigger)
└── README.md            # This documentation

The modernized version consolidates everything into a single, well-structured file for better maintainability while preserving all functionality.

πŸ“Š Example Usage

# Test the modernized version curl -X POST "https://your-val-url.web.val.run/?key=test" \ -H "Content-Type: text/html" \ -d "<!DOCTYPE html><html><head><title>Test</title></head><body><h1>It works!</h1><p>Large HTML support βœ…</p></body></html>" # View the result curl "https://your-val-url.web.val.run/?key=test" # Get JSON metadata curl "https://your-val-url.web.val.run/?key=test&format=json"
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.