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=378&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 15603 results for "fetch"(7137ms)

Pomodoroindex.ts1 match

@ommywaters•Updated 1 month ago
30app.get("/health", c => c.json({ status: "ok", timestamp: new Date().toISOString() }));
31
32export default app.fetch;

PomodoroApp.tsx3 matches

@ommywaters•Updated 1 month ago
28 const loadPresets = async () => {
29 try {
30 const response = await fetch('/api/timers');
31 if (response.ok) {
32 const data = await response.json();
77 const handlePresetSave = async (preset: Omit<TimerPreset, 'id' | 'createdAt'>) => {
78 try {
79 const response = await fetch('/api/timers', {
80 method: 'POST',
81 headers: { 'Content-Type': 'application/json' },
99 const handlePresetDelete = async (id: number) => {
100 try {
101 const response = await fetch(`/api/timers/${id}`, {
102 method: 'DELETE'
103 });

Pomodorotimers.ts4 matches

@ommywaters•Updated 1 month ago
17 return c.json(presets);
18 } catch (error) {
19 console.error("Error fetching timer presets:", error);
20 return c.json({ error: "Failed to fetch timer presets" }, 500);
21 }
22});
37 return c.json(preset);
38 } catch (error) {
39 console.error("Error fetching timer preset:", error);
40 return c.json({ error: "Failed to fetch timer preset" }, 500);
41 }
42});

untitled-6879index.ts1 match

@walyomoben•Updated 1 month ago
34});
35
36export default app.fetch;

untitled-6879ChatRoom.tsx9 matches

@walyomoben•Updated 1 month ago
27 }, [username]);
28
29 // Fetch messages on component mount and set up polling
30 useEffect(() => {
31 fetchMessages();
32 const interval = setInterval(fetchMessages, 3000); // Poll every 3 seconds
33 return () => clearInterval(interval);
34 }, []);
39 }, [messages]);
40
41 const fetchMessages = async () => {
42 try {
43 const response = await fetch('/api/chat/messages');
44 if (!response.ok) {
45 throw new Error('Failed to fetch messages');
46 }
47 const messagesData = await response.json();
73 };
74
75 const response = await fetch('/api/chat/messages', {
76 method: 'POST',
77 headers: {
87
88 setNewMessage('');
89 // Fetch messages immediately to show the new message
90 await fetchMessages();
91 } catch (err) {
92 setError(err instanceof Error ? err.message : 'An error occurred');

untitled-6879JobForm.tsx1 match

@walyomoben•Updated 1 month ago
28
29 try {
30 const response = await fetch('/api/jobs', {
31 method: 'POST',
32 headers: {

untitled-6879JobBoard.tsx6 matches

@walyomoben•Updated 1 month ago
9
10 useEffect(() => {
11 fetchJobs();
12 }, []);
13
14 const fetchJobs = async () => {
15 try {
16 setLoading(true);
17 const response = await fetch('/api/jobs');
18 if (!response.ok) {
19 throw new Error('Failed to fetch jobs');
20 }
21 const jobsData = await response.json();
65 <div className="mt-4">
66 <button
67 onClick={fetchJobs}
68 className="bg-red-100 px-3 py-2 rounded-md text-sm font-medium text-red-800 hover:bg-red-200"
69 >
84 </h2>
85 <button
86 onClick={fetchJobs}
87 className="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition-colors"
88 >

untitled-6879chat.ts2 matches

@walyomoben•Updated 1 month ago
12 return c.json(messages);
13 } catch (error) {
14 console.error('Error fetching chat messages:', error);
15 return c.json({ error: 'Failed to fetch chat messages' }, 500);
16 }
17});

jobindex.ts1 match

@subomi•Updated 1 month ago
39});
40
41export default app.fetch;

untitled-6879jobs.ts4 matches

@walyomoben•Updated 1 month ago
11 return c.json(jobPostings);
12 } catch (error) {
13 console.error('Error fetching jobs:', error);
14 return c.json({ error: 'Failed to fetch job postings' }, 500);
15 }
16});
31 return c.json(job);
32 } catch (error) {
33 console.error('Error fetching job:', error);
34 return c.json({ error: 'Failed to fetch job posting' }, 500);
35 }
36});

manual-fetcher

@miz•Updated 1 day ago

fake-https1 file match

@blazemcworld•Updated 1 week ago
simple proxy to fetch http urls using https