45 const requestUrl = `https://reosablo-uuidGeneratorStream.web.val.run/?count=${requestedCount.val}`;
46 const [response, { TextLineStream }] = await Promise.all([
47 fetch(requestUrl),
48 import("https://deno.land/std@0.224.0/streams/text_line_stream.ts"),
49 ]);
143});
144
145export default app.fetch;
1async function fetchWithTimeout(timeout = 2_000) {
2 const abortSignal = AbortSignal.timeout(timeout);
3
4 try {
5 const response = await fetch("https://jsonplaceholder.typicode.com/posts/1", {
6 signal: abortSignal,
7 });
16}
17
18fetchWithTimeout(2_000).then(console.log);
1import { paths } from "https://esm.town/v/pomdtr/openapi_schema";
2import createClient2 from "npm:openapi-fetch";
3
4/**
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { form } from "https://esm.town/v/stevekrouse/date_me_form";
3import browse from "https://esm.town/v/stevekrouse/dateme_browse";
13app.get("/faq", faq);
14app.get("/rss.xml", c => dateMeRSS(c.req as unknown as Request));
15export default modifyFetchHandler(app.fetch, {
16 style: `@media (max-width: 500px) {
17 .github-fork-ribbon {
65
66const app = new Hono();
67export default app.fetch;
68app.get("/", async (c) => {
69 const url = c.req.query("url");
1import { blob } from "https://esm.town/v/std/blob?v=12";
2import { email } from "https://esm.town/v/std/email?v=9";
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
4
5export let newValTownOpenAPI = async () => {
6 const savedSpec = await blob.getJSON("vtOpenAPI");
7 let currentSpec = await fetchText(
8 "https://www.val.town/docs/openapi.yaml",
9 );
8 params: {
9 query: {
10 query: "fetchJSON",
11 limit: 30,
12 offset: 60,
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3async function post_response(body, f: SlackFunction, config: SlackConfig) {
4 // Note: `body.event` has information about the event like the sender and the message text
5 const text = await f(body);
6 const result = await fetchJSON("https://slack.com/api/chat.postMessage", {
7 headers: { "Authorization": `Bearer ${config.slackToken}` },
8 method: "POST",
1import { paths } from "https://esm.town/v/pomdtr/openapi_schema";
2import createClient2 from "npm:openapi-fetch";
3
4export default function createClient(options?: {