Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

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, });
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { openapi2TS } from "https://esm.town/v/pomdtr/openapi2TS";
export async function valtownOpenAPI(req: Request) {
return new Response(
await openapi2TS(
"https://www.val.town/docs/openapi.yaml",
),
{
headers: {
"Content-Type": "text/typescript",
},
},
);
}
pomdtr-valtownopenapi.web.val.run
October 23, 2023