Public
Readme
To add an example, just create a val. The val should start with a JSDoc style multi line comment that describes the example:
/**
* @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>
You can add another val to your example by adding an @include
directive
/**
* @title HTTP server: Hello World
* @description An example of a HTTP server that serves a "Hello World" message.
* @include pomdtr/secondary_val
*/
You can attach an external link to your val by using the @resource
directive. External resources are specified using a markdown link.
/**
* @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)
**/
Just add your val in @pomdtr/val_town_by_example_toc
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
pomdtr-valtownbyexample.web.val.run
Updated: April 10, 2024