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=13&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 11254 results for "fetch"(4738ms)

WordWarsindex.tsx4 matches

@potluck•Updated 1 day ago
21
22 try {
23 const response = await fetch(`/api/games/${gameId}`);
24 if (response.ok) {
25 const data = await response.json();
40 setIsLoading(true);
41 try {
42 const response = await fetch(`/api/games/${gameId.trim()}/join`, {
43 method: 'POST',
44 headers: { 'Content-Type': 'application/json' },
75
76 try {
77 const response = await fetch(`/api/games/${gameId}/flip`, {
78 method: 'POST',
79 headers: { 'Content-Type': 'application/json' },
112
113 try {
114 const response = await fetch(`/api/games/${gameId}/claim`, {
115 method: 'POST',
116 headers: { 'Content-Type': 'application/json' },

WordWarsindex.ts1 match

@potluck•Updated 1 day ago
171});
172
173export default app.fetch;

personalShopperkrogerAuth.ts7 matches

@bgschiller•Updated 1 day ago
57 const credentials = btoa(`${this.clientId}:${this.clientSecret}`);
58
59 const response = await fetch(`${KROGER_BASE_URL}/v1/connect/oauth2/token`, {
60 method: "POST",
61 headers: {
84 const credentials = btoa(`${this.clientId}:${this.clientSecret}`);
85
86 const response = await fetch(`${KROGER_BASE_URL}/v1/connect/oauth2/token`, {
87 method: "POST",
88 headers: {
108 */
109 async getUserProfile(accessToken: string): Promise<KrogerProfileResponse> {
110 const response = await fetch(`${KROGER_BASE_URL}/v1/identity/profile`, {
111 headers: {
112 Authorization: `Bearer ${accessToken}`,
117 if (!response.ok) {
118 const errorText = await response.text();
119 throw new Error(`Profile fetch failed: ${response.status} ${errorText}`);
120 }
121
179 });
180
181 const response = await fetch(
182 `${KROGER_BASE_URL}/v1/locations?${params.toString()}`,
183 {
206 locationId: string
207 ): Promise<KrogerLocationResponse> {
208 const response = await fetch(
209 `${KROGER_BASE_URL}/v1/locations/${locationId}`,
210 {
218 if (!response.ok) {
219 const errorText = await response.text();
220 throw new Error(`Location fetch failed: ${response.status} ${errorText}`);
221 }
222

Presentationsindex.ts1 match

@wolf•Updated 1 day ago
76});
77
78export default app.fetch;

PresentationsAddPresentation.tsx1 match

@wolf•Updated 1 day ago
37
38 try {
39 const response = await fetch('/api/presentations', {
40 method: 'POST',
41 headers: {

PresentationsPresentationItem.tsx2 matches

@wolf•Updated 1 day ago
44
45 try {
46 const response = await fetch(`/api/presentations/${presentation.id}`, {
47 method: 'PUT',
48 headers: {
69 const confirmRemove = async () => {
70 try {
71 const response = await fetch(`/api/presentations/${presentation.id}`, {
72 method: 'DELETE',
73 });

Presentationsindex.tsx7 matches

@wolf•Updated 1 day ago
6import type { Presentation } from "../shared/types.ts";
7
8// Get initial data from server-side injection or fetch from API
9const getInitialData = (): Presentation[] => {
10 if (typeof window !== 'undefined' && (window as any).__INITIAL_DATA__) {
45 upcomingPresentationDay.setUTCMilliseconds(0);
46
47 const fetchPresentations = async () => {
48 setLoading(true);
49 try {
50 const response = await fetch('/api/presentations');
51 const data = await response.json();
52 setPresentations(data);
53 } catch (error) {
54 console.error('Error fetching presentations:', error);
55 } finally {
56 setLoading(false);
59
60 useEffect(() => {
61 // Only fetch if we don't have initial data
62 if (presentations.length === 0) {
63 fetchPresentations();
64 }
65 }, []);
70 presentations={presentations}
71 firstThursday={firstThursday}
72 onRefresh={fetchPresentations}
73 loading={loading}
74 />

embedmain.ts1 match

@g•Updated 1 day ago
94app.get("/main.js", serve(js, "text/javascript"));
95
96export default app.fetch;

nyc-mapindex.ts1 match

@thomasinch•Updated 1 day ago
23});
24
25export default app.fetch;

townie-testingserveFile.md1 match

@chadparker•Updated 1 day ago
71
72 // Inject initial data to avoid extra round-trips
73 const initialData = await fetchInitialData();
74 const dataScript = `<script>
75 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};

fetch-socials4 file matches

@welson•Updated 20 hours ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 1 day ago