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/?q=fetch&page=501&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 7880 results for "fetch"(746ms)

MaplJITmain.tsx3 matches

@aquapi•Updated 7 months ago
22 });
23
24const fetch = jitc(app);
25console.log(fetch.toString());
26
27export default fetch;

count_visitsmain.tsx8 matches

@nicosql•Updated 7 months ago
11 if (!websiteUrl) return;
12
13 const response = await fetch("/generate-embed", {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },
25
26 useEffect(() => {
27 const fetchVisitorCount = async () => {
28 if (websiteUrl) {
29 const response = await fetch(`/visitor-count?url=${encodeURIComponent(websiteUrl)}`);
30 if (response.ok) {
31 const { count } = await response.json();
35 };
36
37 fetchVisitorCount();
38 const interval = setInterval(fetchVisitorCount, 5000);
39 return () => clearInterval(interval);
40 }, [websiteUrl]);
96
97 useEffect(() => {
98 const fetchCount = async () => {
99 const response = await fetch('${url.origin}/count-visitor?url=${encodedUrl}');
100 if (response.ok) {
101 const { count } = await response.json();
104 };
105
106 fetchCount();
107 }, []);
108

harshAquamarineRoostermain.tsx2 matches

@nicosql•Updated 7 months ago
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {

renewedAmethystRattlesnakemain.tsx2 matches

@pperi•Updated 7 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));

compactAmberMongoosemain.tsx5 matches

@pperi•Updated 7 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";
17 expect(upload_route).toBeTruthy();
18 expect(passwordAuth).toBeTruthy();
19 expect(modifyFetchHandler).toBeTruthy();
20});
21
27 expect(upload_route).toBeTruthy();
28 expect(passwordAuth).toBeTruthy();
29 expect(modifyFetchHandler).toBeTruthy();
30});
31
37 expect(await upload_route({})).toBeTruthy();
38 expect(await passwordAuth({})).toBeTruthy();
39 expect(await modifyFetchHandler({})).toBeTruthy();
40};
41
168});
169
170export default modifyFetchHandler(passwordAuth(app.fetch));

blob_adminmain.tsx2 matches

@pperi•Updated 7 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 7 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 7 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 7 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 7 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: {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago