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=540&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 8300 results for "fetch"(1002ms)

argsummain.tsx4 matches

@martinbowling•Updated 7 months ago
146 try {
147 const url = '${url}';
148 const response = await fetch(url, {
149 method: 'POST',
150 headers: {
156 if (!response.ok) {
157 let errorJson = await response.json();
158 console.error('Fetch Error:', errorJson);
159 showError('Error fetching data: ' + (errorJson.message || 'Unknown error'));
160 return;
161 }
359app.get("/", (c) => c.html(html));
360
361export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;

blob_adminmain.tsx2 matches

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

sqliteExplorerAppmain.tsx4 matches

@molefrog•Updated 7 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

schedulermain.tsx6 matches

@elliotbraem•Updated 7 months ago
314
315 async function loadCalendars() {
316 const response = await fetch('/calendars');
317 const calendars = await response.json();
318 const calendarList = document.getElementById('calendarList');
346 return;
347 }
348 await fetch('/calendars', {
349 method: 'POST',
350 headers: { 'Content-Type': 'application/json' },
356
357 async function deleteCalendar(id) {
358 await fetch('/calendars', {
359 method: 'DELETE',
360 headers: { 'Content-Type': 'application/json' },
370 async function viewCalendar(id) {
371 currentCalendarId = id;
372 const response = await fetch('/calendars');
373 const calendars = await response.json();
374 const calendar = calendars.find(c => c.id === id);
440 userAvailability.clear();
441 overallAvailability = {};
442 const response = await fetch(\`/availability?calendarId=\${currentCalendarId}\`);
443
444 const data = await response.json();
476 const available = !userAvailability.has(key);
477
478 const response = await fetch('/availability', {
479 method: 'POST',
480 headers: { 'Content-Type': 'application/json' },

whatsThatAgainInHotDogsmain.tsx2 matches

@dthyresson•Updated 7 months ago
118 function calculateHotdogs() {
119 const playerName = document.getElementById('playerSelect').value;
120 fetch('/calculate?player=' + encodeURIComponent(playerName))
121 .then(response => response.json())
122 .then(data => {
175
176export default async function handler(request: Request): Promise<Response> {
177 return app.fetch(request)
178}
179

excaliValmain.tsx2 matches

@all•Updated 7 months ago
149 const generatedName = `excali${generateRandomName(selectedOptions)}`;
150
151 const response = await fetch("/create-val", {
152 method: "POST",
153 headers: {
245
246 // Create a new val using the Val Town API
247 const response = await fetch("https://api.val.town/v1/vals", {
248 method: "POST",
249 headers: {

excaliValmain.tsx2 matches

@stevekrouse•Updated 7 months ago
149 const generatedName = `excali${generateRandomName(selectedOptions)}`;
150
151 const response = await fetch("/create-val", {
152 method: "POST",
153 headers: {
245
246 // Create a new val using the Val Town API
247 const response = await fetch("https://api.val.town/v1/vals", {
248 method: "POST",
249 headers: {

pushmain.tsx2 matches

@jrmann100•Updated 7 months ago
1/** @jsxImportSource npm:hono@3/jsx */
2import { modifyFetchHandler as codeOnValTownBanner } from "https://esm.town/v/andreterron/codeOnValTown";
3import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth";
4import { Hono } from "npm:hono@3";
125
126export default codeOnValTownBanner(
127 passwordAuth(app.fetch, { verifyPassword: verifyToken }),
128);

valiantSalmonWarblermain.tsx1 match

@maxm•Updated 7 months ago
30 // handler may only run once now, where in the old runtime it
31 // ran on every request. To migrate your code, you may have to
32 // move some code that was outside your fetch handler to run inside it.
33 // </p>
34

valiantSalmonWarblermain.tsx1 match

@stevekrouse•Updated 7 months ago
22 handler may only run once now, where in the old runtime it
23 ran on every request. To migrate your code, you may have to
24 move some code that was outside your fetch handler to run inside it.
25 </p>
26

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago