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/$2?q=fetch&page=18&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 14173 results for "fetch"(1450ms)

fetchJSON1 file match

@dvergin•Updated 1 year ago

fetchBcycleCounts1 file match

@jonbo•Updated 1 year ago

EEPPortalweeklyReport.tsx18 matches

@solomonferede•Updated 1 hour ago
318 };
319
320 // Function to fetch the detailed report
321 const fetchDetailedReport = async () => {
322 setDetailedReport(null); // Clear previous detailed data while fetching
323 try {
324 const response = await fetch("/generate-report"); // Assuming this endpoint provides detailed data
325 const data = await response.json();
326 setDetailedReport(data);
327 } catch (error) {
328 console.error("Failed to fetch detailed report:", error);
329 showCustomAlert("Failed to fetch detailed report."); // Use custom alert
330 }
331 };
332
333 // Function to fetch the weekly summary report with custom days
334 const fetchWeeklySummary = async (days = 7) => {
335 setWeeklySummary(null); // Clear previous summary data while fetching
336 try {
337 // This fetches the summary data for the specified number of days for all users
338 const response = await fetch(`/generate-weekly-summary?days=${days}`);
339 const data = await response.json();
340 setWeeklySummary(data);
341 } catch (error) {
342 console.error("Failed to fetch weekly summary:", error);
343 showCustomAlert("Failed to fetch weekly summary."); // Use custom alert
344 }
345 };
346
347 // Effect to fetch data when the view changes or component mounts
348 useEffect(() => {
349 // Fetch data for the current view
350 if (currentView === "detailed") {
351 fetchDetailedReport();
352 } else if (currentView === "summary") {
353 fetchWeeklySummary(daysToShow);
354 }
355 // Reset pagination and filters when changing tabs
377 }
378 setDaysToShow(days);
379 // No need to call fetchWeeklySummary here - it will be triggered by the effect
380 };
381

esmesm.ts1 match

@a1107954•Updated 3 hours ago
53 );
54 }
55 const resp = await fetch(new URL(url.pathname, "https://esm.town").toString(), {
56 method: req.method,
57 headers: req.headers,