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/$1?q=fetch&page=4&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 10806 results for "fetch"(589ms)

Smart_Expense_TrackerTravelPlanner.tsx5 matches

@gunjana_04•Updated 9 hours ago
17 const [user, setUser] = useState<any>(null);
18
19 const fetchData = async () => {
20 try {
21 setLoading(true);
22 const [destinationsRes, userRes] = await Promise.all([
23 fetch('/api/goals/travel-destinations'),
24 fetch('/api/user/profile')
25 ]);
26
48
49 useEffect(() => {
50 fetchData();
51 }, [refreshTrigger]);
52
64
65 try {
66 const response = await fetch('/api/goals', {
67 method: 'POST',
68 headers: {

Smart_Expense_TrackerGoalTracker.tsx10 matches

@gunjana_04•Updated 9 hours ago
23 const [addingMoney, setAddingMoney] = useState<{ goalId: number; amount: string } | null>(null);
24
25 const fetchGoals = async () => {
26 try {
27 setLoading(true);
28 const response = await fetch('/api/goals');
29 const data = await response.json();
30 if (data.success) {
35 type: 'error',
36 title: 'Error',
37 message: 'Failed to fetch goals'
38 });
39 } finally {
43
44 useEffect(() => {
45 fetchGoals();
46 }, [refreshTrigger]);
47
68
69 try {
70 const response = await fetch('/api/goals', {
71 method: 'POST',
72 headers: {
95 setShowForm(false);
96 onRefresh();
97 fetchGoals();
98 } else {
99 onNotification({
123
124 try {
125 const response = await fetch(`/api/goals/${goalId}/progress`, {
126 method: 'POST',
127 headers: {
142 setAddingMoney(null);
143 onRefresh();
144 fetchGoals();
145 } else {
146 onNotification({
165
166 try {
167 const response = await fetch(`/api/goals/${goalId}`, {
168 method: 'DELETE',
169 });
178 });
179 onRefresh();
180 fetchGoals();
181 } else {
182 onNotification({

Smart_Expense_TrackerExpenseForm.tsx7 matches

@gunjana_04•Updated 9 hours ago
20 const [quickAmounts] = useState([50, 100, 200, 500, 1000]);
21
22 const fetchRecentExpenses = async () => {
23 try {
24 const response = await fetch('/api/expenses?limit=10');
25 const data = await response.json();
26 if (data.success) {
28 }
29 } catch (error) {
30 console.error('Failed to fetch recent expenses:', error);
31 }
32 };
33
34 useEffect(() => {
35 fetchRecentExpenses();
36 }, [refreshTrigger]);
37
60
61 try {
62 const response = await fetch('/api/expenses', {
63 method: 'POST',
64 headers: {
114
115 try {
116 const response = await fetch(`/api/expenses/${expenseId}`, {
117 method: 'DELETE',
118 });
127 });
128 onRefresh();
129 fetchRecentExpenses();
130 } else {
131 onNotification({

Smart_Expense_TrackerDashboard.tsx7 matches

@gunjana_04•Updated 9 hours ago
19 });
20
21 const fetchDashboardData = async () => {
22 try {
23 setLoading(true);
24
25 const [monthlyReportRes, expensesRes, goalsRes, insightsRes, userRes] = await Promise.all([
26 fetch('/api/analytics/monthly-report'),
27 fetch('/api/expenses?limit=5'),
28 fetch('/api/goals'),
29 fetch('/api/analytics/insights'),
30 fetch('/api/user/profile')
31 ]);
32
58
59 useEffect(() => {
60 fetchDashboardData();
61 }, [refreshTrigger]);
62

Smart_Expense_Trackerindex.ts1 match

@gunjana_04•Updated 9 hours ago
84 // For SPA, serve index.html for all non-API routes
85 if (!c.req.path.startsWith("/api/")) {
86 return app.fetch(new Request(new URL("/", c.req.url)));
87 }
88

Smart_Expense_Trackeruser.ts2 matches

@gunjana_04•Updated 9 hours ago
24 return c.json({
25 success: false,
26 error: "Failed to fetch user profile"
27 }, 500);
28 }
82 return c.json({
83 success: false,
84 error: "Failed to fetch budgets"
85 }, 500);
86 }

Smart_Expense_Trackeranalytics.ts1 match

@gunjana_04•Updated 9 hours ago
36 return c.json({
37 success: false,
38 error: "Failed to fetch spending trends"
39 }, 500);
40 }

Smart_Expense_Trackergoals.ts2 matches

@gunjana_04•Updated 9 hours ago
15 return c.json({
16 success: false,
17 error: "Failed to fetch goals"
18 }, 500);
19 }
136 return c.json({
137 success: false,
138 error: "Failed to fetch travel destinations"
139 }, 500);
140 }

Smart_Expense_Trackerexpenses.ts1 match

@gunjana_04•Updated 9 hours ago
23 return c.json({
24 success: false,
25 error: "Failed to fetch expenses"
26 }, 500);
27 }

untitled-9454App.tsx3 matches

@Varun07•Updated 9 hours ago
23 setLoading(true);
24 try {
25 const response = await fetch("/api/login", {
26 method: "POST",
27 headers: {
50 setLoading(true);
51 try {
52 const response = await fetch("/api/register", {
53 method: "POST",
54 headers: {
75 setLoading(true);
76 try {
77 await fetch("/api/logout", {
78 method: "POST",
79 });

HN-fetch-call2 file matches

@ImGqb•Updated 9 hours ago
fetch HackerNews by API

FRAMERFetchBasic1 file match

@bresnik•Updated 1 day ago