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%20%22Optional%20title%22?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 8213 results for "fetch"(490ms)

blogindex.ts2 matches

@fil•Updated 4 hours ago
39});
40
41// Export the fetch handler for Val Town
42export default liveReload(app.fetch, import.meta.url);

whatsapp-callbackindex.tsx4 matches

@yawnxyz•Updated 4 hours ago
24 // Send a reply message
25 try {
26 await fetch(
27 `https://graph.facebook.com/v18.0/${business_phone_number_id}/messages`,
28 {
44
45 // Mark incoming message as read
46 await fetch(
47 `https://graph.facebook.com/v18.0/${business_phone_number_id}/messages`,
48 {
92});
93
94// Export app.fetch for Val Town, otherwise export app
95export default (typeof Deno !== "undefined" && Deno.env.get("valtown"))
96 ? app.fetch
97 : app;

TownieuseProject.tsx5 matches

@charmaine•Updated 4 hours ago
11 const [error, setError] = useState(null);
12
13 const fetchData = async () => {
14 try {
15 const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
23 };
24
25 const { project } = await fetch(projectEndpoint, { headers })
26 .then(res => res.json());
27 const { files } = await fetch(filesEndpoint, { headers })
28 .then(res => res.json());
29
40 useEffect(() => {
41 if (!projectId) return;
42 fetchData();
43 }, [projectId, branchId]);
44
45 return { data, loading, error, refetch: fetchData };
46}
47

TownieuseProjects.tsx5 matches

@charmaine•Updated 4 hours ago
10 const [error, setError] = useState(null);
11
12 const fetchData = async () => {
13 try {
14 const res = await fetch(ENDPOINT, {
15 headers: {
16 "Authorization": "Bearer " + token,
18 })
19 const data = await res.json();
20 console.log("useProjects fetchData", { res, data });
21 if (!res.ok) {
22 console.error(data);
39
40 useEffect(() => {
41 fetchData();
42 }, []);
43
44 return { data, loading, error, refetch: fetchData };
45}
46

TownieuseCreateProject.tsx1 match

@charmaine•Updated 4 hours ago
19 setError(null);
20 try {
21 const res = await fetch(ENDPOINT, {
22 method: "POST",
23 headers: {

TownieuseCreateBranch.tsx1 match

@charmaine•Updated 4 hours ago
16 setData(null);
17 setError(null);
18 const res = await fetch(ENDPOINT, {
19 method: "POST",
20 headers: {

TownieuseBranches.tsx4 matches

@charmaine•Updated 4 hours ago
9 const [loading, setLoading] = useState(true);
10
11 const fetchData = async () => {
12 const endpoint = new URL(ENDPOINT, window.location.origin);
13 endpoint.searchParams.append("projectId", projectId);
14
15 const res = await fetch(endpoint, {
16 headers: {
17 "Authorization": "Bearer " + token,
24 useEffect(() => {
25 if (!projectId) return;
26 fetchData();
27 }, [projectId]);
28
29 return { data, loading, refetch: fetchData };
30}
31

TownieuseAuth.tsx1 match

@charmaine•Updated 4 hours ago
15 // replace all this with oauth when it's ready
16 try {
17 const res = await fetch("/api/user", {
18 headers: {
19 "Authorization": "Bearer " + valTownAPIKey,

Townieusage-dashboard.ts3 matches

@charmaine•Updated 4 hours ago
59 // If we get here, authentication was successful
60
61 // Fetch all rows from the usage table
62 // Fetch all rows from the usage table
63 const allUsageData = await sqlite.execute(`SELECT * FROM ${USAGE_TABLE} ORDER BY timestamp DESC`);
64
65 // Fetch aggregated data grouped by user_id
66 const groupedUsageData = await sqlite.execute(`
67 SELECT

TownieTODOs.md1 match

@charmaine•Updated 4 hours ago
47<!--
48
49- [x] refetch project data on create/etc
50- [x] Loading favicon
51- [x] Ensure main branch is default selected

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago