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=354&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 7881 results for "fetch"(1484ms)

CRMmain.tsx20 matches

@juecd•Updated 3 months ago
10 e.preventDefault();
11 try {
12 const response = await fetch("/login", {
13 method: "POST",
14 headers: { "Content-Type": "application/json" },
58 const [tagInput, setTagInput] = useState("");
59
60 // Fetch previous customer details when email changes
61 useEffect(() => {
62 const fetchCustomerDetails = async () => {
63 if (!email) return;
64
65 try {
66 const response = await fetch(`/get-customer-details?email=${encodeURIComponent(email)}`);
67 if (response.ok) {
68 const customerDetails = await response.json();
73 }
74 } catch (error) {
75 console.error("Error fetching customer details:", error);
76 }
77 };
78
79 fetchCustomerDetails();
80 }, [email]);
81
138 e.preventDefault();
139 try {
140 const response = await fetch("/add-interaction", {
141 method: "POST",
142 headers: { "Content-Type": "application/json" },
250 const [uniqueCustomerCount, setUniqueCustomerCount] = useState(0);
251
252 const fetchUniqueCustomerCount = async () => {
253 try {
254 const response = await fetch("/get-unique-customer-count");
255 const data = await response.json();
256 setUniqueCustomerCount(data.count);
257 } catch (error) {
258 console.error("Error fetching unique customer count:", error);
259 }
260 };
261
262 useEffect(() => {
263 fetchInteractions();
264 fetchUniqueCustomerCount();
265 }, [currentPage, selectedTags]);
266
281 const handleDeleteInteraction = async (id) => {
282 try {
283 const response = await fetch("/delete-interaction", {
284 method: "DELETE",
285 headers: { "Content-Type": "application/json" },
288
289 if (response.ok) {
290 fetchInteractions();
291 }
292 } catch (error) {
303 };
304
305 const fetchInteractions = async () => {
306 try {
307 const response = await fetch(`/get-interactions?page=${currentPage}`);
308 const data = await response.json();
309
336 if (selectedTags.length > 0) {
337 // Need to get total count of filtered interactions from server
338 const filteredCountResponse = await fetch(`/get-filtered-count?tags=${selectedTags.join(",")}`);
339 const filteredCountData = await filteredCountResponse.json();
340 setTotalInteractions(filteredCountData.count);
343 }
344 } catch (error) {
345 console.error("Error fetching interactions:", error);
346 }
347 };
348
349 useEffect(() => {
350 fetchInteractions();
351 }, [currentPage, selectedTags]);
352
481 const checkAuth = async () => {
482 try {
483 const response = await fetch("/check-auth");
484 const data = await response.json();
485 setIsAuthenticated(data.authenticated);

isMyWebsiteDownmain.tsx2 matches

@BaronVonLeskis•Updated 3 months ago
14 start = performance.now();
15 try {
16 const res = await fetch(url);
17 end = performance.now();
18 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

OpenTowniesystem_prompt.txt2 matches

@AIWB•Updated 3 months ago
155 * The main App component is rendered on the client.
156 * No server-side-specific code should be included in the App.
157 * Use fetch to communicate with the backend server portion.
158 */
159function App() {
178 * Server-only code
179 * Any code that is meant to run on the server should be included in the server function.
180 * This can include endpoints that the client side component can send fetch requests to.
181 */
182export default async function server(request: Request): Promise<Response> {

OpenTownieindex1 match

@AIWB•Updated 3 months ago
26
27 try {
28 const response = await fetch("/", {
29 method: "POST",
30 headers: { "authorization": "Bearer " + bearerToken },

OpenTowniegenerateCode1 match

@AIWB•Updated 3 months ago
26
27export async function generateCodeAnthropic(messages: Message[]): Promise<ValResponse | null> {
28 const system = await (await fetch(`${import.meta.url.split("/").slice(0, -1).join("/")}/system_prompt.txt`)).text();
29
30 const openai = new OpenAI({

ThumbMakermain.tsx1 match

@AIWB•Updated 3 months ago
394app.get('/main.js', serve(js, 'text/javascript'));
395
396export default app.fetch;

azureDinosaurmain.tsx2 matches

@AIWB•Updated 3 months ago
1import { fetchFile, toBlobURL } from "https://esm.sh/@ffmpeg/util";
2import { FFmpeg } from "https://maxm-emeraldox.web.val.run/@ffmpeg/ffmpeg";
3
8 wasmURL: `https://esm.sh/@ffmpeg/core@0.12.6/dist/umd/ffmpeg-core.wasm`,
9});
10console.log(FFmpeg, fetchFile, toBlobURL);

createWebsitemain.tsx4 matches

@Mostafa3135•Updated 3 months ago
68 e.preventDefault();
69 try {
70 const response = await fetch(`${API_BASE_URL}/login`, {
71 method: 'POST',
72 headers: { 'Content-Type': 'application/json' },
121
122 try {
123 const response = await fetch(`${API_BASE_URL}/signup`, {
124 method: 'POST',
125 headers: { 'Content-Type': 'application/json' },
181
182 try {
183 const response = await fetch(`${API_BASE_URL}/upload`, {
184 method: 'POST',
185 body: formData
215
216 try {
217 const response = await fetch(`${API_BASE_URL}/chat`, {
218 method: 'POST',
219 headers: { 'Content-Type': 'application/json' },

sqliteAdminDashboardmain.tsx15 matches

@alpaca1712•Updated 3 months ago
15
16 useEffect(() => {
17 fetchTables();
18 }, []);
19
20 const fetchTables = async () => {
21 try {
22 const response = await fetch("/tables");
23 const data = await response.json();
24 setTables(data);
25 } catch (err) {
26 setError("Failed to fetch tables");
27 }
28 };
29
30 const fetchTableData = async (tableName) => {
31 try {
32 const dataResponse = await fetch(`/table/${tableName}`);
33 const data = await dataResponse.json();
34 setTableData(data);
35
36 const schemaResponse = await fetch(`/schema/${tableName}`);
37 const schema = await schemaResponse.json();
38 setTableSchema(schema);
46 setNewRow(emptyRow);
47 } catch (err) {
48 setError(`Failed to fetch data for table ${tableName}`);
49 }
50 };
56 const handleSave = async (index) => {
57 try {
58 const response = await fetch(`/update/${selectedTable}`, {
59 method: "POST",
60 headers: {
67 }
68 setEditingRow(null);
69 await fetchTableData(selectedTable);
70 } catch (err) {
71 setError(`Failed to update row: ${err.message}`);
85 const handleAddRow = async () => {
86 try {
87 const response = await fetch(`/insert/${selectedTable}`, {
88 method: "POST",
89 headers: {
95 throw new Error("Failed to add new row");
96 }
97 await fetchTableData(selectedTable);
98 // Reset newRow to empty values
99 const emptyRow = Object.keys(newRow).reduce((acc, key) => {
109 const handleDeleteTable = async () => {
110 try {
111 const response = await fetch(`/table/${selectedTable}`, {
112 method: "DELETE",
113 });
121 setTableData([]);
122 setTableSchema([]);
123 await fetchTables();
124 } catch (err) {
125 setError(`Failed to delete table: ${err.message}`);
135 <li
136 key={table}
137 onClick={() => fetchTableData(table)}
138 className={selectedTable === table ? "active" : ""}
139 >

competentOlivePeacockmain.tsx9 matches

@awhitter•Updated 3 months ago
53
54 useEffect(() => {
55 fetchContent();
56 }, []);
57
58 const fetchContent = async () => {
59 try {
60 const response = await fetch("/api/content");
61 const data = await response.json();
62 if (data.records) {
63 setContent(data.records);
64 } else {
65 throw new Error("Failed to fetch content");
66 }
67 setLoading(false);
68 } catch (error) {
69 console.error("Error fetching content:", error);
70 setLoading(false);
71 }
99 const analyzeContent = async (item: AirtableRecord) => {
100 try {
101 const response = await fetch("/api/analyze", {
102 method: "POST",
103 headers: {
265
266 try {
267 const response = await fetch(airtableUrl, {
268 headers: {
269 "Authorization": `Bearer ${apiToken}`,
279 return new Response(JSON.stringify(data), { headers });
280 } catch (error) {
281 console.error("Error fetching Airtable data:", error);
282 return new Response(JSON.stringify({ error: "Error fetching data from Airtable" }), {
283 status: 500,
284 headers,

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago