Public
Like
1
codesearch
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: v22View latest version
A web application for searching through your Val Town vals using the Val Town API.
- Search through all your vals by name, content, or description
- Filter by val type (HTTP, cron, email, script)
- View val details including code content
- Direct links to edit vals in Val Town
- Real-time search with debouncing
- Responsive design with TailwindCSS
βββ backend/
β βββ index.ts # Main Hono server
β βββ routes/
β βββ api.ts # Val Town API integration
βββ frontend/
β βββ index.html # Main HTML template
β βββ index.tsx # React frontend entry point
β βββ components/
β βββ App.tsx # Main app component
β βββ SearchBar.tsx # Search input component
β βββ ValCard.tsx # Individual val display
β βββ FilterBar.tsx # Type filters
βββ shared/
βββ types.ts # Shared TypeScript types
-
Get your Val Town API token:
- Go to Val Town API Settings
- Create a new API token
- Copy the token
-
Set the environment variable:
- In your Val Town project, set
VALTOWN_API_TOKENto your API token - The app will automatically detect when the token is available
- In your Val Town project, set
-
Access the app:
- The app will be available at your HTTP endpoint
- If the token isn't set, you'll see instructions on the homepage
- Search: Type in the search bar to find vals by name, content, or description
- Filter: Use the type filters to narrow results by val type (HTTP, cron, email, script)
- View Code: Each val card shows a preview of the code with syntax highlighting
- Quick Actions: Click "Run" to execute HTTP vals, or "Edit in Val Town" to modify them
- Real-time Search: Results update as you type with intelligent debouncing
- Keyboard Shortcuts: Press
Cmd/Ctrl + Kto quickly focus the search bar - Clear Search: Click the Γ button or use the clear button to reset your search
- Search is case-insensitive and matches partial words
- Use specific terms to narrow down results quickly
- Filter by type to focus on specific kinds of vals
- The search looks through val names, code content, and descriptions
- Results show the total number of lines in each val
- Privacy levels are clearly indicated (public, private, unlisted)
GET /- Serves the main applicationGET /api/vals- Search vals with query parameters:q- Search query (optional)type- Filter by val type (optional)limit- Number of results (default: 50)