• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
pomdtr

pomdtr

valtownByExample

Public
Like
3
valtownByExample
Home
Code
2
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
/
Code
/
Search
main.tsx
https://pomdtr--e489dc44277f11f0b46e569c3dd06744.web.val.run
README.md

Val town by example

Usage

Simple Example

To add an example, just create a val. The val should start with a JSDoc style multi line comment that describes the example:

Create val
/** * @title HTTP server: Hello World * @description An example of a HTTP server that serves a "Hello World" message. */ // this comment will be displayed on the left export const server = () => new Response("Hello world!")

The title is required.

Then, you can write the code. Code can be prefixed with a comment that describes the code. The comment will be rendered next to the code in the example page.

Make sure your val is public, then go to https://pomdtr-val_town_by_example.web.val.run/v/<your-username>/<your-val>

Using multiple vals

You can add another val to your example by adding an @include directive

Create val
/** * @title HTTP server: Hello World * @description An example of a HTTP server that serves a "Hello World" message. * @include pomdtr/secondary_val */

See @pomdtr/react_example

Adding external resources to your example

You can attach an external link to your val by using the @resource directive. External resources are specified using a markdown link.

Create val
/** * @title HTTP server: Hello World * @description An example of a HTTP server that serves a "Hello World" message. * @resource [Val Town Docs](https://docs.val.town) **/

Adding examples to the homepage

Just add your val in @pomdtr/val_town_by_example_toc

HTTP
  • main.tsx
    pomdtr--e4…44.web.val.run
Code
README.md
H
main.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.