1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(await fetchJSON("https://api.val.town/v1/alias/stevekrouse"));
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(await fetchJSON("https://api.val.town/v1/vals/7f9019e4-dbf8-4ebe-b8cd-67730697624e/versions"));
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(await fetchJSON("https://api.val.town/v1/vals/7f9019e4-dbf8-4ebe-b8cd-67730697624e"));
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=43";
2
3console.log(await fetchJSON("https://api.val.town/v1/users/a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18/vals"));
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3console.log(
4 await fetchJSON(
5 "https://api.val.town/v1/eval",
6 {
9 search_by_date: true,
10 });
11 // for each post get the number of upvotes from the hackernews api using fetch
12 for (let post of posts) {
13 let res = await fetch(`https://hacker-news.firebaseio.com/v0/item/${post.objectID}.json`);
14 post.upvotes = await res.json();
15 }
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3console.log(
4 await fetchJSON(
5 "https://api.val.town/v1/eval",
6 {
152
153export async function sendNotification(baseURL: string, body: NtfyJSONBody): Promise<Response> {
154 return await fetch(baseURL, {
155 method: "POST",
156 body: JSON.stringify(body),
82 return new Response(
83 `/// <reference no-default-lib="true"/>\n`
84 + ((await Promise.all(urls.map(url => fetch(url).then(res => res.text())))).join("\n\n").replace(
85 /^\/\/\/.+/gm,
86 "",
228});
229
230export default app.fetch;