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}
8 department: "Product",
9 locations: ["New York", "San Francisco", "Remote"],
10 url: "https://boards-api.greenhouse.io/v1/boards/mongodb/jobs?content=true",
11 source: "greenhouse",
12 },
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
8 limit: "10",
1import { runVal } from "https://esm.town/v/std/runVal";
2
3export const apiExample = runVal("patrickjm.gpt3", {
4 prompt: "write me a poem about tralee",
5});
1import { runtime } from "https://esm.town/v/easrng/runtime";
2
3export const API_URL = await runtime() === "v3-staging"
4 ? "https://api.v3.val.town"
5 : "https://api.val.town";