Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Burl%7D?q=fetch&page=1045&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 13318 results for "fetch"(1341ms)

blob_adminmain.tsx2 matches

@pperi•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

blobbymain.tsx2 matches

@yawnxyz•Updated 8 months ago
3
4// this causes timeouts for uploadfromfileurl
5// import { fetch } from "https://esm.town/v/std/fetch";
6
7export class Blobby {
135 url = 'https://' + url.replace(/^(http:\/\/)?/, '');
136 }
137 const response = await fetch(url);
138 const arrayBuffer = await response.arrayBuffer();
139 await blob.set(this.getKey(key), arrayBuffer);

arenaApiExamplemain.tsx2 matches

@deblina•Updated 8 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let arenaApiExample = (async () => {
4 const resp = await fetch(
5 "http://api.are.na/v2/channels/project-logs",
6 );

arenaApiExampleREADME.md1 match

@deblina•Updated 8 months ago
3Example of using the [are.na](https://dev.are.na/documentation/channels#Block43472) API to get the contents of an Are.na board - specifically my fun board that showcases websites with that "glossy black style."
4
5All you need is [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make this happen!

bbrunmain.tsx1 match

@kenbarrett•Updated 8 months ago
115 const body = await req.json() as { $key: string };
116 body.$key = $key;
117 const response = await fetch(endpointURL, {
118 method: "POST",
119 headers: {

bbaasfemain.tsx2 matches

@nlnhsr•Updated 8 months ago
142 }
143 }
144 const response = await fetch(createEndpointUrl("invoke"), {
145 method: "POST",
146 body: JSON.stringify(body),
152};
153
154const data = await (await fetch(createEndpointUrl("describe"), { method: "POST" }))
155 .json() as NodeDescriberResult;
156

openaiproxymain.tsx2 matches

@roadlabs•Updated 8 months ago
28 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
29 const token = authHeader ? parseBearerString(authHeader) : undefined;
30 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
31 if (!meRes.ok) {
32 return new Response("Unauthorized", { status: 401 });
63 });
64
65 const openAIRes = await fetch(url, {
66 method: req.method,
67 headers,

bbaasfemain.tsx2 matches

@odicho•Updated 8 months ago
210 }
211 }
212 const response = await fetch(createEndpointUrl("invoke"), {
213 method: "POST",
214 body: JSON.stringify(body),
220};
221
222const data = await (await fetch(createEndpointUrl("describe"), { method: "POST" }))
223 .json() as NodeDescriberResult;
224

bbrunmain.tsx1 match

@yejun•Updated 8 months ago
115 const body = await req.json() as { $key: string };
116 body.$key = $key;
117 const response = await fetch(endpointURL, {
118 method: "POST",
119 headers: {

cooingTomatoSquirrelmain.tsx2 matches

@mrsnor•Updated 8 months ago
94 tokenUrl.searchParams.set("state", store.state);
95
96 const tokenResp = await fetch(tokenUrl.toString());
97 if (!tokenResp.ok) {
98 throw new Error(await tokenResp.text());
103 };
104
105 const resp = await fetch("https://lastlogin.io/userinfo", {
106 headers: {
107 Authorization: `Bearer ${access_token}`,

GithubPRFetcher

@andybak•Updated 1 day ago

proxiedfetch1 file match

@jayden•Updated 2 days ago