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=101&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 8523 results for "fetch"(1024ms)

Lizmain.tsx6 matches

@Salvation1133•Updated 2 weeks ago
9
10 useEffect(() => {
11 fetchExperiences();
12 }, []);
13
14 async function fetchExperiences() {
15 try {
16 const response = await fetch("/experiences");
17 const data = await response.json();
18 setExperiences(data);
19 } catch (error) {
20 console.error("Failed to fetch experiences", error);
21 }
22 }
28 setIsSubmitting(true);
29 try {
30 const response = await fetch("/submit", {
31 method: "POST",
32 headers: { "Content-Type": "application/json" },
36 if (response.ok) {
37 setExperience("");
38 fetchExperiences();
39 }
40 } catch (error) {

spacexspaceximage.tsx1 match

@moe•Updated 2 weeks ago
3
4export default async function(req: Request): Promise<Response> {
5 // const data = await fetch("https://moe-spacexapi.web.val.run").then((res) => res.json())
6 // const l = data.launches[0]
7 // console.log(l)

LUKOYESTUDYTRUSTmain.tsx1 match

@Dr_Lukoye•Updated 2 weeks ago
100
101 try {
102 const response = await fetch("/register", {
103 method: "POST",
104 headers: {

ObawalLearningHUBmain.tsx2 matches

@obawal•Updated 2 weeks ago
43 setError(null);
44 try {
45 const response = await fetch("/auth/google", { method: "POST" });
46 if (!response.ok) {
47 throw new Error("Authentication failed");
72 const handleLogout = async () => {
73 try {
74 await fetch("/auth/logout", { method: "POST" });
75 setUser(null);
76 localStorage.removeItem("obawal_user");

NaijaHandleFindermain.tsx12 matches

@StanleyAkegbeotu•Updated 2 weeks ago
25 setIsUsernameModalOpen(true);
26 }
27 fetchJobs();
28 fetchChatMessages();
29 }, []);
30
31 const fetchJobs = async () => {
32 try {
33 const response = await fetch('/jobs');
34 const data = await response.json();
35 setJobs(data);
36 } catch (error) {
37 console.error('Error fetching jobs:', error);
38 }
39 };
40
41 const fetchChatMessages = async () => {
42 try {
43 const response = await fetch('/chat');
44 const data = await response.json();
45 setChatMessages(data);
46 } catch (error) {
47 console.error('Error fetching chat messages:', error);
48 }
49 };
67 }
68 try {
69 const response = await fetch('/jobs', {
70 method: 'POST',
71 headers: { 'Content-Type': 'application/json' },
73 });
74 if (response.ok) {
75 fetchJobs();
76 setNewJob({ title: '', company: '', description: '', location: '', salary: '' });
77 }
88 }
89 try {
90 const response = await fetch('/chat', {
91 method: 'POST',
92 headers: { 'Content-Type': 'application/json' },
94 });
95 if (response.ok) {
96 fetchChatMessages();
97 setNewMessage('');
98 }

Voice_Remindermain.tsx7 matches

@Scolly•Updated 2 weeks ago
12
13 useEffect(() => {
14 // Fetch existing reminders on component mount
15 const fetchReminders = async () => {
16 try {
17 const response = await fetch('/list-reminders');
18 if (!response.ok) {
19 throw new Error('Failed to fetch reminders');
20 }
21 const data = await response.json();
32 };
33
34 fetchReminders();
35 }, []);
36
72 formData.append('reminderDate', parsedDate.toISOString());
73
74 const response = await fetch('/save-reminder', {
75 method: 'POST',
76 body: formData
250 : null;
251 } catch (error) {
252 console.error(`Error fetching reminder ${key}:`, error);
253 return null;
254 }

Flashcard_Generatormain.tsx1 match

@dev_me•Updated 2 weeks ago
21 const generateFlashcards = async () => {
22 try {
23 const response = await fetch('/generate-flashcards', {
24 method: 'POST',
25 body: JSON.stringify({ content }),

sbirmain.tsx16 matches

@salon•Updated 2 weeks ago
42 current_status?: string | null;
43 solicitation_topics?: SolicitationTopic[];
44 fetch_error?: string;
45 id?: string;
46}
377 + " try {"
378 + " var apiUrl = window.location.pathname + '?action=analyze_sbir&format=json';"
379 + " var response = await fetch(apiUrl, {"
380 + " method: 'POST',"
381 + " headers: {"
517}
518
519async function fetchSBIRSolicitations(
520 criteria: SBIRSearchCriteria,
521 log: LogFunction,
523 const MAX_ROWS = 10;
524 const BASE_URL = "https://api.www.sbir.gov/public/api/solicitations";
525 const logPrefix = "SBIR API Fetch";
526
527 log("[STEP] " + logPrefix + ": Building API request...");
544
545 const apiUrl = BASE_URL + "?" + params.toString();
546 log("[INFO] " + logPrefix + ": Fetching URL: " + apiUrl);
547
548 try {
549 const response = await fetch(apiUrl, {
550 method: "GET",
551 headers: {
627
628 log(
629 "[SUCCESS] " + logPrefix + ": Successfully fetched and processed " + validSolicitations.length
630 + " solicitations.",
631 );
632 return { solicitations: validSolicitations, rawCount: rawCount };
633 } catch (error) {
634 log("[CRITICAL ERROR] " + logPrefix + ": Unexpected error during fetch/processing: " + error.message);
635 console.error(logPrefix + " Unexpected Error:", error);
636 return { error: "Unexpected server error during SBIR API fetch: " + error.message };
637 }
638}
648
649 try {
650 log("[STEP] Fetching SBIR Solicitations from API...");
651 const fetchResult = await fetchSBIRSolicitations(criteria, log);
652
653 if (fetchResult.error) {
654 log("[ERROR] Failed to fetch solicitations from SBIR API: " + fetchResult.error);
655 return { error: "Failed to retrieve funding opportunities from SBIR.gov.", details: fetchResult.error };
656 }
657
658 solicitations = fetchResult.solicitations || [];
659
660 if (solicitations.length === 0) {
805 intermediate_results: {
806 userCriteria: criteria,
807 fetchedSolicitationsCount: solicitations.length,
808 analysisResults: analysisResults,
809 },

jobBoardWithChatAppmain.tsx19 matches

@Mrigbalode•Updated 2 weeks ago
50
51 try {
52 const response = await fetch('/post-job', {
53 method: 'POST',
54 headers: { 'Content-Type': 'application/json' },
130
131 try {
132 const response = await fetch('/send-message', {
133 method: 'POST',
134 headers: { 'Content-Type': 'application/json' },
146
147 useEffect(() => {
148 async function fetchMessages() {
149 try {
150 const response = await fetch('/get-messages');
151 const fetchedMessages = await response.json();
152 setMessages(fetchedMessages);
153 } catch (error) {
154 console.error('Error fetching messages:', error);
155 }
156 }
157 fetchMessages();
158 const interval = setInterval(fetchMessages, 5000);
159 return () => clearInterval(interval);
160 }, []);
193
194 useEffect(() => {
195 async function fetchJobs() {
196 try {
197 const response = await fetch('/get-jobs');
198 const fetchedJobs = await response.json();
199 setJobs(fetchedJobs);
200 } catch (error) {
201 console.error('Error fetching jobs:', error);
202 }
203 }
204 if (userName) {
205 fetchJobs();
206 }
207 }, [userName]);
310 });
311 } catch (error) {
312 console.error("Job fetching error:", error);
313 return new Response(`Job fetching error: ${error.message}`, { status: 500 });
314 }
315 }
326 });
327 } catch (error) {
328 console.error("Message fetching error:", error);
329 return new Response(`Message fetching error: ${error.message}`, { status: 500 });
330 }
331 }

weddingRSVPTOForevermain.tsx1 match

@Mrigbalode•Updated 2 weeks ago
55
56 try {
57 const response = await fetch('/submit-rsvp', {
58 method: 'POST',
59 headers: { 'Content-Type': 'application/json' },

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago