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?q=fetch&page=169&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 10336 results for "fetch"(715ms)

embed-servicesmax-cron.tsx3 matches

@temptemp•Updated 1 week ago
1const script = `
2export default {
3 async fetch(request, env, ctx) {
4 const url = new URL(request.url);
5 url.host = "embed-hono.lime4042.workers.dev";
6 console.log(url)
7 const r = await fetch(url,request);
8 return new Response((r).body,r);
9 },
19 files.append("uuid", uuid);
20 files.append("token", key);
21 const upload = await fetch(
22 `https://temptemp-workers.web.val.run/pushCode?uuid=${uuid}&token=${key}`,
23 {

Bee_AIindex.tsx1 match

@quartex•Updated 1 week ago
42
43 try {
44 const response = await fetch("/ask", {
45 method: "POST",
46 body: JSON.stringify({ question }),

testDaily.tsx11 matches

@xhaka•Updated 1 week ago
23 const [paymentMethodFilter, setPaymentMethodFilter] = useState<PaymentMethodFilter>(null);
24
25 // Fetch sales and payment data
26 const fetchSalesData = async (startDate: Date, endDate: Date) => {
27 setIsLoading(true);
28 setError(null);
32 const dateTo = endDate.toISOString().split('T')[0];
33
34 // Fetch both data sets in parallel
35 const [salesResponse, paymentsResponse] = await Promise.all([
36 getSaleWaiters(dateFrom, dateTo),
39
40 if (salesResponse && paymentsResponse) {
41 console.log('Fetched sales data:', salesResponse.length, 'records');
42 console.log('Fetched payment data:', paymentsResponse.length, 'records');
43
44 setSalesData(salesResponse);
49 }
50 } catch (error) {
51 setError('Failed to fetch sales data. Please try again.');
52 console.error('Fetch error:', error);
53 } finally {
54 setIsLoading(false);
130 error,
131 paymentMethodFilter,
132 fetchSalesData,
133 filterByCashPayment,
134 filterByBankPayment,
144 error,
145 paymentMethodFilter,
146 fetchSalesData,
147 filterByCashPayment,
148 filterByBankPayment,
174 const startDate = new Date();
175 startDate.setDate(startDate.getDate() - 6);
176 fetchSalesData(startDate, endDate);
177 }, []);
178
197 <View className='mb-6'>
198 <DateRangeSelector
199 onDateRangeChange={fetchSalesData}
200 additionalButtons={paymentMethodButtons}
201 />

cerebras_coderindex.ts1 match

@w3b•Updated 1 week ago
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({

plantprofileindex.ts1 match

@seipatiannah1•Updated 1 week ago
27
28// Export the app for HTTP val
29export default app.fetch;

plantprofileApp.tsx10 matches

@seipatiannah1•Updated 1 week ago
25 const [isEditing, setIsEditing] = useState(false);
26
27 // Fetch all plants on component mount
28 useEffect(() => {
29 fetchPlants();
30 }, []);
31
32 const fetchPlants = async () => {
33 try {
34 setIsLoading(true);
35 const response = await fetch("/api/plants");
36 const data = await response.json();
37
39 setPlants(data.data || []);
40 } else {
41 setError(data.error || "Failed to fetch plants");
42 }
43 } catch (err) {
52 try {
53 setIsLoading(true);
54 const response = await fetch(`/api/plants/${id}`);
55 const data = await response.json();
56
58 setSelectedPlant(data.data);
59 } else {
60 setError(data.error || "Failed to fetch plant details");
61 }
62 } catch (err) {
71 try {
72 setIsLoading(true);
73 const response = await fetch("/api/plants", {
74 method: "POST",
75 headers: {
99 try {
100 setIsLoading(true);
101 const response = await fetch(`/api/plants/${id}`, {
102 method: "PUT",
103 headers: {
131 try {
132 setIsLoading(true);
133 const response = await fetch(`/api/plants/${id}`, {
134 method: "DELETE",
135 });

plantprofileplants.ts4 matches

@seipatiannah1•Updated 1 week ago
17 return c.json({ success: true, data: profiles });
18 } catch (error) {
19 console.error("Error fetching plant profiles:", error);
20 return c.json({ success: false, error: "Failed to fetch plant profiles" }, 500);
21 }
22});
37 return c.json({ success: true, data: profile });
38 } catch (error) {
39 console.error("Error fetching plant profile:", error);
40 return c.json({ success: false, error: "Failed to fetch plant profile" }, 500);
41 }
42});

FirstProjectindex.ts1 match

@MiracleSanctuary•Updated 1 week ago
44
45// Export the Hono app
46export default app.fetch;

FirstProjectindex.js21 matches

@MiracleSanctuary•Updated 1 week ago
55};
56
57// Fetch job listings
58const fetchJobs = async () => {
59 try {
60 const response = await fetch('/api/jobs');
61 if (!response.ok) throw new Error('Failed to fetch jobs');
62
63 const jobs = await response.json();
81 `).join('');
82 } catch (error) {
83 console.error('Error fetching jobs:', error);
84 jobListings.innerHTML = '<p class="text-red-500">Failed to load jobs. Please try again later.</p>';
85 }
104 };
105
106 const response = await fetch('/api/jobs', {
107 method: 'POST',
108 headers: {
119 // Reset form and refresh job listings
120 jobForm.reset();
121 await fetchJobs();
122
123 // Show success message
132});
133
134// Fetch chat messages
135const fetchChatMessages = async () => {
136 try {
137 const response = await fetch('/api/chat');
138 if (!response.ok) throw new Error('Failed to fetch chat messages');
139
140 const messages = await response.json();
166 chatMessages.scrollTop = chatMessages.scrollHeight;
167 } catch (error) {
168 console.error('Error fetching chat messages:', error);
169 chatMessages.innerHTML = '<p class="text-red-500">Failed to load messages. Please try again later.</p>';
170 }
188 document.getElementById('message').focus();
189
190 // Fetch messages and start polling
191 fetchChatMessages();
192 startPolling();
193});
202
203 try {
204 const response = await fetch('/api/chat', {
205 method: 'POST',
206 headers: {
218 }
219
220 // Clear input and fetch new messages
221 messageInput.value = '';
222 await fetchChatMessages();
223 } catch (error) {
224 console.error('Error sending message:', error);
231 if (pollingInterval) clearInterval(pollingInterval);
232
233 pollingInterval = setInterval(fetchChatMessages, 3000);
234};
235
243const init = async () => {
244 setViewSourceLink();
245 await fetchJobs();
246
247 // If on chat tab and username is set, fetch messages and start polling
248 if (currentUsername && !chatContent.classList.contains('hidden')) {
249 await fetchChatMessages();
250 startPolling();
251 }

FirstProjectchat.ts2 matches

@MiracleSanctuary•Updated 1 week 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});

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 5 days ago

proxyFetch2 file matches

@vidar•Updated 1 week ago