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/image-url.jpg%20%22Optional%20title%22?q=fetch&page=6&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 8213 results for "fetch"(752ms)

cf-uploadermain.tsx1 match

@temptemp•Updated 4 hours ago
10 files.append("uuid", uuid);
11 files.append("token", key);
12 const upload = await fetch(
13 `https://temptemp-workers.web.val.run/pushCode?uuid=${uuid}&token=${key}`,
14 {

adportalcontinue.html6 matches

@devto•Updated 5 hours ago
264 logToUI('Testing blob storage...');
265 try {
266 const response = await fetch(`/test-blob-storage?submissionId=${submissionId}`);
267 const result = await response.json();
268
337 logToUI(`Sending file to server...`);
338
339 const response = await fetch('/upload-image', {
340 method: 'POST',
341 body: formData
394 logToUI(`Loading images for submission: ${submissionId}`);
395 try {
396 logToUI(`Fetching from /list-images?submissionId=${submissionId}`);
397 const response = await fetch(`/list-images?submissionId=${submissionId}`);
398
399 if (!response.ok) {
502
503 try {
504 const response = await fetch('/image', {
505 method: 'DELETE',
506 headers: {
571 formDataObj.id = submissionId;
572
573 const response = await fetch(`/update`, {
574 method: 'POST',
575 headers: {

adportalindex.ts1 match

@devto•Updated 5 hours ago
358
359// This is the entry point for HTTP vals
360export default app.fetch;

blob_adminmain.tsx1 match

@devto•Updated 5 hours ago
199});
200
201export default lastlogin((request: Request) => app.fetch(request));

blob_adminapp.tsx22 matches

@devto•Updated 5 hours ago
231 const [isDragging, setIsDragging] = useState(false);
232
233 const fetchBlobs = useCallback(async () => {
234 setLoading(true);
235 try {
236 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
237 const data = await response.json();
238 setBlobs(data);
239 } catch (error) {
240 console.error("Error fetching blobs:", error);
241 } finally {
242 setLoading(false);
245
246 useEffect(() => {
247 fetchBlobs();
248 }, [fetchBlobs]);
249
250 const handleSearch = (e) => {
261 setBlobContentLoading(true);
262 try {
263 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
264 const content = await response.text();
265 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
266 setEditContent(content);
267 } catch (error) {
268 console.error("Error fetching blob content:", error);
269 } finally {
270 setBlobContentLoading(false);
275 const handleSave = async () => {
276 try {
277 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
278 method: "PUT",
279 body: editContent,
287 const handleDelete = async (key) => {
288 try {
289 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
290 setBlobs(blobs.filter(b => b.key !== key));
291 if (selectedBlob && selectedBlob.key === key) {
304 const key = `${searchPrefix}${file.name}`;
305 formData.append("key", encodeKey(key));
306 await fetch("/api/blob", { method: "POST", body: formData });
307 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
308 setBlobs([newBlob, ...blobs]);
312 }
313 }
314 fetchBlobs();
315 };
316
326 try {
327 const fullKey = `${searchPrefix}${key}`;
328 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
329 method: "PUT",
330 body: "",
341 const handleDownload = async (key) => {
342 try {
343 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
344 const blob = await response.blob();
345 const url = window.URL.createObjectURL(blob);
360 if (newKey && newKey !== oldKey) {
361 try {
362 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
363 const content = await response.blob();
364 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
365 method: "PUT",
366 body: content,
367 });
368 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
369 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
370 if (selectedBlob && selectedBlob.key === oldKey) {
380 const newKey = `__public/${key}`;
381 try {
382 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
383 const content = await response.blob();
384 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
385 method: "PUT",
386 body: content,
387 });
388 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
389 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
390 if (selectedBlob && selectedBlob.key === key) {
399 const newKey = key.slice(9); // Remove "__public/" prefix
400 try {
401 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
402 const content = await response.blob();
403 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
404 method: "PUT",
405 body: content,
406 });
407 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
408 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
409 if (selectedBlob && selectedBlob.key === key) {

adportallanding.html1 match

@devto•Updated 5 hours ago
117 const formData = new FormData(form);
118
119 const response = await fetch('/submit', {
120 method: 'POST',
121 body: formData

blob_adminmain.tsx1 match

@asdfg•Updated 6 hours ago
199});
200
201export default lastlogin((request: Request) => app.fetch(request));

blob_adminapp.tsx22 matches

@asdfg•Updated 6 hours ago
231 const [isDragging, setIsDragging] = useState(false);
232
233 const fetchBlobs = useCallback(async () => {
234 setLoading(true);
235 try {
236 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
237 const data = await response.json();
238 setBlobs(data);
239 } catch (error) {
240 console.error("Error fetching blobs:", error);
241 } finally {
242 setLoading(false);
245
246 useEffect(() => {
247 fetchBlobs();
248 }, [fetchBlobs]);
249
250 const handleSearch = (e) => {
261 setBlobContentLoading(true);
262 try {
263 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
264 const content = await response.text();
265 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
266 setEditContent(content);
267 } catch (error) {
268 console.error("Error fetching blob content:", error);
269 } finally {
270 setBlobContentLoading(false);
275 const handleSave = async () => {
276 try {
277 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
278 method: "PUT",
279 body: editContent,
287 const handleDelete = async (key) => {
288 try {
289 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
290 setBlobs(blobs.filter(b => b.key !== key));
291 if (selectedBlob && selectedBlob.key === key) {
304 const key = `${searchPrefix}${file.name}`;
305 formData.append("key", encodeKey(key));
306 await fetch("/api/blob", { method: "POST", body: formData });
307 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
308 setBlobs([newBlob, ...blobs]);
312 }
313 }
314 fetchBlobs();
315 };
316
326 try {
327 const fullKey = `${searchPrefix}${key}`;
328 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
329 method: "PUT",
330 body: "",
341 const handleDownload = async (key) => {
342 try {
343 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
344 const blob = await response.blob();
345 const url = window.URL.createObjectURL(blob);
360 if (newKey && newKey !== oldKey) {
361 try {
362 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
363 const content = await response.blob();
364 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
365 method: "PUT",
366 body: content,
367 });
368 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
369 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
370 if (selectedBlob && selectedBlob.key === oldKey) {
380 const newKey = `__public/${key}`;
381 try {
382 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
383 const content = await response.blob();
384 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
385 method: "PUT",
386 body: content,
387 });
388 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
389 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
390 if (selectedBlob && selectedBlob.key === key) {
399 const newKey = key.slice(9); // Remove "__public/" prefix
400 try {
401 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
402 const content = await response.blob();
403 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
404 method: "PUT",
405 body: content,
406 });
407 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
408 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
409 if (selectedBlob && selectedBlob.key === key) {

tinyfeedhttp.ts1 match

@pomdtr•Updated 8 hours ago
2
3export default async function(req: Request): Promise<Response> {
4 return tinyfeed.fetch(req);
5}
108 // Get detailed PR info including checks status
109 try {
110 const prDetails = await fetchPRDetails(payload.repository.full_name, payload.pull_request.number);
111 console.log(`PR mergeable status: ${prDetails.mergeable}, state: ${prDetails.mergeable_state}`);
112
130 return new Response("Notification sent to Slack", { status: 200 });
131 } catch (prError) {
132 console.error("Error fetching PR details or sending notification:", prError);
133 return new Response(`Error: ${prError.message}`, { status: 500 });
134 }
211}
212
213// Fetch detailed PR information including checks status
214async function fetchPRDetails(repo: string, prNumber: number) {
215 const token = Deno.env.get("GITHUB_TOKEN");
216 if (!token) {
223 let response;
224 try {
225 response = await fetch(url, {
226 headers: {
227 "Authorization": `token ${token}`,
230 },
231 });
232 } catch (fetchError) {
233 throw new Error(`Network error fetching PR details: ${fetchError.message}`);
234 }
235
236 if (!response.ok) {
237 throw new Error(`Failed to fetch PR details: ${response.status} ${response.statusText}`);
238 }
239
255 // First, verify the PR is still mergeable
256 try {
257 const prDetails = await fetchPRDetails(repo, prNumber);
258
259 if (!prDetails.mergeable) {
284 const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}/merge`;
285
286 const response = await fetch(url, {
287 method: "PUT",
288 headers: {
415
416 // Send message to Slack
417 const response = await fetch(slackWebhookUrl, {
418 method: "POST",
419 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago