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/$%7Bart_info.art.src%7D?q=fetch&page=104&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 8649 results for "fetch"(1477ms)

Projectmain.tsx4 matches

@ladyflo0600•Updated 2 weeks ago
40 });
41
42 // Fetch products on component mount
43 useEffect(() => {
44 fetch(import.meta.url, { method: 'GET' })
45 .then(response => response.json())
46 .then(data => setProducts(data.products));
82 e.preventDefault();
83 try {
84 const response = await fetch(import.meta.url, {
85 method: 'POST',
86 headers: { 'Content-Type': 'application/json' },
296 }
297
298 // Handle GET request to fetch products
299 if (request.method === 'GET') {
300 const productsResult = await sqlite.execute(`SELECT * FROM ${KEY}_products`);

timeTrackerAppmain.tsx8 matches

@Judith_123•Updated 2 weeks ago
12 useEffect(() => {
13 const timer = setInterval(() => setCurrentTime(new Date()), 1000);
14 fetchRecentRecords();
15 return () => clearInterval(timer);
16 }, []);
17
18 const fetchRecentRecords = async () => {
19 try {
20 const response = await fetch('/recent-records');
21 const records = await response.json();
22 setRecentRecords(records);
23 } catch (error) {
24 console.error('Failed to fetch recent records', error);
25 }
26 };
33
34 try {
35 const response = await fetch('/clock-action', {
36 method: 'POST',
37 headers: {
43 setStatus(result.status);
44 setLastClockIn(result.timestamp);
45 fetchRecentRecords();
46 } catch (error) {
47 console.error('Clock action failed', error);
51 const handleExportToExcel = async () => {
52 try {
53 const response = await fetch('/export-excel');
54 const blob = await response.blob();
55 const url = window.URL.createObjectURL(blob);
173 }
174
175 // Fetch recent records
176 if (request.method === 'GET' && new URL(request.url).pathname === '/recent-records') {
177 const recentRecords = await sqlite.execute(`

englishways_migratedmain.tsx7 matches

@maryamdorgam•Updated 2 weeks ago
20
21 useEffect(() => {
22 fetch('/username')
23 .then(response => response.text())
24 .then(name => {
25 if (name) {
26 setUsername(name);
27 fetchArticles();
28 }
29 });
30 }, []);
31
32 const fetchArticles = () => {
33 fetch('/articles')
34 .then(response => response.json())
35 .then(data => setArticles(data));
46 const handleUsernameSubmit = () => {
47 if (editingUsername.trim()) {
48 fetch('/username', {
49 method: 'POST',
50 body: editingUsername.trim()
54 setUsername(name);
55 setShowWelcome(false);
56 fetchArticles();
57 });
58 }
66 const handleUsernameSave = () => {
67 if (editingUsername.trim()) {
68 fetch('/username', {
69 method: 'POST',
70 body: editingUsername.trim()

shiftSchedulermain.tsx7 matches

@icing•Updated 2 weeks ago
13
14 useEffect(() => {
15 fetchShifts();
16 }, []);
17
18 const fetchShifts = async () => {
19 const response = await fetch("/shifts");
20 const data = await response.json();
21 setShifts(data);
29 const addShift = async (e) => {
30 e.preventDefault();
31 await fetch("/shifts", {
32 method: "POST",
33 headers: { "Content-Type": "application/json" },
34 body: JSON.stringify(newShift)
35 });
36 fetchShifts();
37 setNewShift({ employeeName: "", date: "", startTime: "", endTime: "" });
38 };
39
40 const deleteShift = async (id) => {
41 await fetch(`/shifts/${id}`, { method: "DELETE" });
42 fetchShifts();
43 };
44

globalCareIndustriesWebsitemain.tsx1 match

@Judith_123•Updated 2 weeks ago
116
117 try {
118 const response = await fetch("/submit-contact", {
119 method: "POST",
120 headers: {

ChatGPTclonemain.tsx1 match

@olamultiply•Updated 2 weeks ago
90
91 try {
92 const response = await fetch('/chat', {
93 method: 'POST',
94 headers: { 'Content-Type': 'application/json' },

staticChessmain.tsx2 matches

@maxm•Updated 2 weeks ago
11
12 constructor() {}
13 async fetch(req: Request): Promise<Response> {
14 if (new URL(req.url).pathname === "/robots.txt") {
15 return new Response("User-agent: *\nDisallow: /");
234const sc = new StaticChess();
235
236export default analyticsHandlerWrapper(sc.fetch.bind(sc));

My_trackermain.tsx11 matches

@Ghostriad007•Updated 2 weeks ago
10 const handleSubmit = async (e) => {
11 e.preventDefault();
12 const response = await fetch("/jobs", {
13 method: "POST",
14 headers: { "Content-Type": "application/json" },
55
56 useEffect(() => {
57 fetchMessages();
58 const interval = setInterval(fetchMessages, 5000);
59 return () => clearInterval(interval);
60 }, []);
61
62 const fetchMessages = async () => {
63 const response = await fetch("/messages");
64 if (response.ok) {
65 const data = await response.json();
70 const sendMessage = async (e) => {
71 e.preventDefault();
72 const response = await fetch("/messages", {
73 method: "POST",
74 headers: { "Content-Type": "application/json" },
77 if (response.ok) {
78 setNewMessage("");
79 fetchMessages();
80 }
81 };
107 const [jobs, setJobs] = useState([]);
108
109 const fetchJobs = async () => {
110 const response = await fetch("/jobs");
111 if (response.ok) {
112 const data = await response.json();
116
117 useEffect(() => {
118 fetchJobs();
119 }, []);
120
125 <div className="job-section">
126 <h2>Post a Job</h2>
127 <JobPostingForm onSubmit={fetchJobs} />
128 <div className="job-list">
129 <h2>Current Openings</h2>

birthdayRemindermain.tsx1 match

@Leo123•Updated 2 weeks ago
59 }
60
61 // Fetch and process birthdays
62 const result = await sqlite.execute(`
63 SELECT name, birthday, email, reminder_days

vtEditorFiles.cursorrules3 matches

@std•Updated 2 weeks ago
239
240 // Inject data to avoid extra round-trips
241 const initialData = await fetchInitialData();
242 const dataScript = `<script>
243 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
286
2875. **API Design:**
288 - `fetch` handler is the entry point for HTTP vals
289 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
290
291

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago