pomdtr
I mainly enjoy building dev tools:
- VS Code integration: https://github.com/pomdtr/valtown-vscode
- CLI: https://github.com/pomdtr/vt
Public vals
317
pomdtr
sunbeamValTownFn
HTTP
Sunbeam integration for Val Town Installation First, install sunbeam . Then create a new val referencing this val. const sunbeamValtown = @pomdtr.sunbeamValTownFn(@me.secrets.valtown) then switch it's visibility to unlisted. You can then install your val in sunbeam # install the extension
sunbeam extension install --alias valtown val:<username>/sunbeamValtown Usage sunbeam valtown # list your vals
sunbeam valtown --help # list available commands Demo
1
pomdtr
run
HTTP
Augmented run api This val is a wrapper on top of the val.town run api, improving it with additional features: basic auth content-type header in response based on url file extension Usage Custom Content-Type The content-type will be inferred from the filename using the mime-types library. If you use a .html extension, the response will be interpreted as text/html ~ $ curl -v 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.html'
HTTP/1.1 200 OK
...
Content-Type: text/html; charset=utf-8
...
Hello, World! If you switch the extension to .txt , the content-type header switch to text/raw . ~ $ curl -v 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.txt'
HTTP/1.1 200 OK
...
Content-Type: text/plain; charset=utf-8
...
Hello, World! Passing arguments The request is proxyed to the run api, so you can pass args to your vals via query params or body. See the run api docs for more details. ~ $ curl -X POST -d '{"args": ["pomdtr"]}' 'https://pomdtr-run.web.val.run/pomdtr/helloWorld.html'
...
< content-type: text/html; charset=utf-8
...
Hello, pomdtr! Basic Authentication Just add your val town token as the username: curl 'https://<val-token>@pomdtr-run.web.val.run/pomdtr/privateVal.txt'
4
pomdtr
valtownOpenAPI
HTTP
Val Town Typescript Spec This val return an up-to-date typescript version of the val.town openapi spec for usage with a feTS client. Usage Deno script import { createClient, type NormalizeOAS } from "npm:fets";
import openapi from "https://pomdtr-valtownOpenAPI.web.val.run/openapi.ts";
export const client = createClient<NormalizeOAS<typeof openapi>>({
endpoint: openapi.servers[0].url,
});
2