4 const username = "stevekrouse";
5 const user = await fetchJSON(
6 `https://api.github.com/users/${username}`,
7 );
8 let totalStars = 0;
11 while (pages--) {
12 const repositories = await fetchJSON(
13 `https://api.github.com/users/${username}/repos?per_page=100&page=${
14 pages + 1
15 }`,
1export function wrapInHTMLElements(
2 elements: string | string[],
3 html: string
9
10 let response = await fetch(
11 `https://www.sevenrooms.com/api-yoa/availability/widget/range?venue=${venue}&time_slot=${time_slot}&party_size=${party_size}&halo_size_interval=5&start_date=${start_date}&num_days=1&channel=SEVENROOMS_WIDGET`
12 );
13 let body = await response.json();
1import { openapi2TS } from "https://esm.town/v/pomdtr/openapi2TS";
2
3export async function valtownOpenAPI(req: Request) {
4 return new Response(
5 await openapi2TS(
6 "https://www.val.town/docs/openapi.yaml",
7 ),
8 {
30 }
31 const resp = await fetch(
32 `https://api.val.town/v1/search/vals?query=${query}`,
33 );
34 if (!resp.ok) {
63 case "view-val": {
64 const { id } = args;
65 const resp = await fetch(`https://api.val.town/v1/vals/${id}`);
66 if (!resp.ok) {
67 return resp;
1export function myApi(name) {
2 return "hi " + name;
3}
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);
1export function myApi(name) {
2 return "hi " + name + " fobar";
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}