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/$%7Burl%7D?q=fetch&page=15&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 9268 results for "fetch"(612ms)

inputtestindex.tsx2 matches

@vawogbemi•Updated 22 hours ago
55
56 const handleSearch = () => {
57 // This is just a demo - in a real app, you'd fetch actual results
58 if (searchQuery.trim() === "") {
59 setResults([]);
165
166 const handleSearch = () => {
167 // This is just a demo - in a real app, you'd fetch actual results
168 if (searchQuery.trim() === "") {
169 setResults([]);

ddindex.ts1 match

@shadowemperor•Updated 1 day ago
76
77// Export the app
78export default app.fetch;

ddindex.js4 matches

@shadowemperor•Updated 1 day ago
911 const method = state.currentDiagramId ? 'PUT' : 'POST';
912
913 const response = await fetch(url, {
914 method,
915 headers: {
944async function loadSavedDiagrams() {
945 try {
946 const response = await fetch('/api/diagrams');
947 const diagrams = await response.json();
948
1001
1002 try {
1003 const response = await fetch(\`/api/diagrams/\${id}\`);
1004 const diagram = await response.json();
1005
1028async function deleteDiagramFromServer(id) {
1029 try {
1030 const response = await fetch(\`/api/diagrams/\${id}\`, {
1031 method: 'DELETE'
1032 });

GodinoDashboard.tsx7 matches

@godinoarts•Updated 1 day ago
20 const [loading, setLoading] = useState<boolean>(true);
21
22 // Fetch KYC status on component mount
23 useEffect(() => {
24 fetchKYCStatus();
25 }, []);
26
27 // Fetch KYC status
28 const fetchKYCStatus = async () => {
29 try {
30 setLoading(true);
31 const response = await fetch("/api/kyc/status", {
32 headers: {
33 Authorization: `Bearer ${token}`
40 }
41 } catch (error) {
42 console.error("Error fetching KYC status:", error);
43 } finally {
44 setLoading(false);
52 return <WalletDashboard token={token} kycStatus={kycStatus} />;
53 case "kyc":
54 return <KYCForm token={token} kycStatus={kycStatus} onKYCSubmitted={fetchKYCStatus} />;
55 case "send":
56 return <SendMoney token={token} />;

GodinoAuthPage.tsx1 match

@godinoarts•Updated 1 day ago
26 : { name, email, password };
27
28 const response = await fetch(endpoint, {
29 method: "POST",
30 headers: {

GodinoApp.tsx6 matches

@godinoarts•Updated 1 day ago
19 setToken(storedToken);
20 setIsAuthenticated(true);
21 fetchUserData(storedToken, storedUserId);
22 } else {
23 setLoading(false);
25 }, []);
26
27 // Fetch user data
28 const fetchUserData = async (authToken: string, userId: string) => {
29 try {
30 const response = await fetch(`/api/user/${userId}`, {
31 headers: {
32 Authorization: `Bearer ${authToken}`
42 }
43 } catch (error) {
44 console.error("Error fetching user data:", error);
45 } finally {
46 setLoading(false);
54 setToken(authToken);
55 setIsAuthenticated(true);
56 fetchUserData(authToken, userId);
57 };
58

Godinoindex.ts1 match

@godinoarts•Updated 1 day ago
65
66// Export the app
67export default app.fetch;

Godinoexchange-rates.ts1 match

@godinoarts•Updated 1 day ago
2
3// Simulated exchange rates
4// In a real application, these would be fetched from an external API
5const exchangeRates: ExchangeRate[] = [
6 { from_currency: "USD", to_currency: "GBP", rate: 0.78 },

aqiutils.ts3 matches

@jwsy•Updated 1 day ago
1import { blob } from "https://esm.town/v/std/blob?v=12";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { msDay } from "https://esm.town/v/stevekrouse/msDay";
4import { msHour } from "https://esm.town/v/stevekrouse/msHour";
25 lon: number;
26}) => {
27 const { results } = await fetchJSON(
28 `${BASE_URL}/v3/locations?`
29 + new URLSearchParams({
50export async function openAqNowcastAQI(location) {
51 const sensorID = location.sensors.find(s => s.parameter.name === "pm25").id;
52 const data = await fetchJSON(
53 `${BASE_URL}/v3/sensors/${sensorID}/measurements?`
54 + new URLSearchParams({

aqiproxy.ts1 match

@jwsy•Updated 1 day ago
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5 return fetch(TARGET_URL + url.pathname + url.search, {
6 headers: {
7 "X-API-Key": Deno.env.get("OpenAQ_API_KEY") as string,

proxyFetch2 file matches

@vidar•Updated 1 day ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 2 days ago