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

chadparker

cp-root

Public
Like
cp-root
Home
Code
6
.townie
1
README.md
H
index.tsx
H
old-get_vals_endpoints.tsx
H
read-vals.tsx
H
scan-vals.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
1
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
6/3/2025
Viewing readonly version of main branch: v115
View latest version
README.md

Val Town Endpoints Scanner

A router-based API for scanning and managing Val Town endpoints across all your vals.

API Endpoints

Main Router (/index.tsx)

  • GET / - API documentation and available endpoints
  • GET /health - Health check endpoint
  • GET /scan - Optimized endpoint scanner (recommended)
  • GET /scan-old - Legacy endpoint scanner with additional debugging info

Individual Scanners

  • /scan-vals.tsx - Optimized scanner implementation
  • /old-get_vals_endpoints.tsx - Legacy scanner implementation

Features

  • πŸ” Scans all your Val Town vals for endpoints.* files (js, jsx, ts, tsx)
  • 🌐 Tests HTTP endpoints and captures responses
  • πŸ“Š Returns structured JSON with endpoint metadata
  • ⚑ Parallel processing for better performance
  • πŸ›‘οΈ Error handling and graceful degradation
  • πŸ“‹ API documentation and health checks

Environment Variables

  • VALTOWN_API_TOKEN - Required for accessing Val Town API

Status

Completed βœ…

  • fetch my vals
  • loop through vals
  • look at each val's file list to find endpoints.tsx
  • refine the filtering (endpoints.js, jsx, ts, tsx)
  • read each matching val's endpoints file
  • refactor into helper functions for better maintainability
  • order functions to make sense
  • create router for organized API access
  • add health checks and documentation

Todo πŸ“‹

  • format output
  • fetch it from cloudflare
  • save to db or kv store
  • implement cache invalidation
  • manual refresh endpoint

Usage

The main router provides a clean API interface. Use /scan for the optimized version or /scan-old for the legacy version with additional debugging information.

Example response structure:

{ "count": 2, "vals_with_endpoints": [ { "id": "val-id", "name": "my-val", "author": "username", "url": "https://www.val.town/v/username/my-val", "endpoints_files": [ { "name": "endpoints.tsx", "path": "/endpoints.tsx", "http_url": "https://username--valid.web.val.run", "http_status": 200, "http_response": "..." } ] } ] }
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
Β© 2025 Val Town, Inc.