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?q=fetch&page=176&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 15790 results for "fetch"(6623ms)

tanstackReactHonoExamplerouter.tsx1 match

@charmaine•Updated 4 weeks ago
19 queries: {
20 staleTime: 60 * 1000, // 1 minute
21 refetchOnWindowFocus: false,
22 },
23 },

tanstackReactHonoExampleREADME.md1 match

@charmaine•Updated 4 weeks ago
41
42- `GET /` - Serves the React application with initial data
43- `GET /api/messages` - Fetch all messages (JSON)
44- `POST /api/messages` - Create a new message
45- `GET /public/**` - Static assets (CSS, JS, etc.)

tanstackReactHonoExamplequeries.ts5 matches

@charmaine•Updated 4 weeks ago
2import { type Message } from "../../shared/utils.ts";
3
4// Fetch messages query
5export function useMessages(initialData?: Message[]) {
6 return useQuery({
7 queryKey: ["messages"],
8 queryFn: async () => {
9 const response = await fetch("/api/messages");
10 if (!response.ok) {
11 throw new Error("Failed to fetch messages");
12 }
13 const data = await response.json();
25 return useMutation({
26 mutationFn: async (content: string) => {
27 const response = await fetch("/api/messages", {
28 method: "POST",
29 headers: { "Content-Type": "application/json" },
38 },
39 onSuccess: () => {
40 // Invalidate and refetch messages
41 queryClient.invalidateQueries({ queryKey: ["messages"] });
42 },

tanstackReactHonoExampleindex.ts2 matches

@charmaine•Updated 4 weeks ago
58});
59
60// HTTP vals expect an exported "fetch handler"
61// This is how you "run the server" in Val Town with Hono
62export default app.fetch;

anchorPDSanchor_pds_implementation_plan.md1 match

@tijs•Updated 4 weeks ago
91**Individual Record Access:**
92- Implement `com.atproto.sync.getRecord` for external clients
93- Allow other servers/clients to fetch specific check-in records
94- Required for federation and embedding
95

anchorPDSval-town.md3 matches

@tijs•Updated 4 weeks ago
216
217 // Inject data to avoid extra round-trips
218 const initialData = await fetchInitialData();
219 const dataScript = `<script>
220 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
266
2675. **API Design:**
268 - `fetch` handler is the entry point for HTTP vals
269 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
270
2716. **Hono Peculiarities:**

stevensDemosendDailyBrief.ts1 match

@lurst•Updated 4 weeks ago
135 const lastSunday = today.startOf("week").minus({ days: 1 });
136
137 // Fetch relevant memories using the utility function
138 const memories = await getRelevantMemories();
139

stevensDemoNotebookView.tsx12 matches

@lurst•Updated 4 weeks ago
67 const [currentPage, setCurrentPage] = useState(1);
68
69 const fetchMemories = useCallback(async () => {
70 setLoading(true);
71 setError(null);
72 try {
73 const response = await fetch(API_BASE);
74 if (!response.ok) {
75 throw new Error(`HTTP error! status: ${response.status}`);
78 setMemories(data);
79 } catch (e) {
80 console.error("Failed to fetch memories:", e);
81 setError(e.message || "Failed to fetch memories.");
82 } finally {
83 setLoading(false);
86
87 useEffect(() => {
88 fetchMemories();
89 }, [fetchMemories]);
90
91 const handleAddMemory = async (e: React.FormEvent) => {
100
101 try {
102 const response = await fetch(API_BASE, {
103 method: "POST",
104 headers: { "Content-Type": "application/json" },
112 setNewMemoryTags("");
113 setShowAddForm(false);
114 await fetchMemories();
115 } catch (e) {
116 console.error("Failed to add memory:", e);
123
124 try {
125 const response = await fetch(`${API_BASE}/${id}`, {
126 method: "DELETE",
127 });
129 throw new Error(`HTTP error! status: ${response.status}`);
130 }
131 await fetchMemories();
132 } catch (e) {
133 console.error("Failed to delete memory:", e);
155
156 try {
157 const response = await fetch(`${API_BASE}/${editingMemory.id}`, {
158 method: "PUT",
159 headers: { "Content-Type": "application/json" },
164 }
165 setEditingMemory(null);
166 await fetchMemories();
167 } catch (e) {
168 console.error("Failed to update memory:", e);

stevensDemoindex.ts2 matches

@lurst•Updated 4 weeks ago
135 ));
136
137// HTTP vals expect an exported "fetch handler"
138export default app.fetch;

stevensDemo.cursorrules5 matches

@lurst•Updated 4 weeks ago
163```
164
1655. **fetchTranspiledJavaScript** - Fetch and transpile TypeScript to JavaScript:
166```ts
167const jsCode = await fetchTranspiledJavaScript("https://esm.town/v/username/project/path/to/file.ts");
168```
169
242
243 // Inject data to avoid extra round-trips
244 const initialData = await fetchInitialData();
245 const dataScript = `<script>
246 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
300
3015. **API Design:**
302 - `fetch` handler is the entry point for HTTP vals
303 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
304 - Properly handle CORS if needed for external access

manual-fetcher

@miz•Updated 5 days ago

fake-https1 file match

@blazemcworld•Updated 2 weeks ago
simple proxy to fetch http urls using https