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/$%7BsvgDataUrl%7D?q=fetch&page=1&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 14071 results for "fetch"(2989ms)

molarmessengermain.tsx2 matches

@Dentalabcs•Updated 47 mins ago
12 }
13 // 🔗 Generate response from OpenAI
14 const aiResponse = await (await fetch("https://api.openai.com/v1/chat/completions", {
15 method: "POST",
16 headers: {
36 console.log("🤖 Final reply to send:", reply);
37 // 📤 Send SMS via Twilio
38 const twilioResponse = await fetch(
39 "https://api.twilio.com/2010-04-01/Accounts/" + Deno.env.get("TWILIO_ACCOUNT_SID") + "/Messages.json",
40 {

huyhieuREADME.md1 match

@lanly•Updated 1 hour ago
19/huyhieu?url=<website>&label=<label>&value=<value>&color=<color>&text=<textColor>&size=<size>&radius=<radius>&shape=<shape>
20```
21- `url` (optional): Website to fetch favicon from
22- `label` (optional): Left text (default: 'huy' if both label and value are missing)
23- `value` (optional): Right text (default: 'hieu' if both label and value are missing)

honeydewmain.tsx3 matches

@legal•Updated 1 hour ago
310
311 try {
312 const res = await fetch(\`\${API_URL}?action=chat\`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ messages: conversationHistory.slice(0, -1), tasks, projects }) });
313 const data = await res.json();
314 if (!res.ok || data.error) throw new Error(data.error || 'Server error');
396 toggleLoading(btn, true);
397 try {
398 const res = await fetch(\`\${API_URL}?action=synthesizeProject\`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ goal }) });
399 const data = await res.json();
400 if (!res.ok || data.error) throw new Error(data.error || "Server error");
414 toggleLoading(btn, true);
415 try {
416 const res = await fetch(\`\${API_URL}?action=dailyRebalance\`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ tasks: todayTasks }) });
417 const data = await res.json();
418 if (!res.ok || data.error) throw new Error(data.error || "Server error");

huyhieumain.js5 matches

@lanly•Updated 2 hours ago
31 <pre><code>/huyhieu?url=&lt;website&gt;&label=&lt;label&gt;&value=&lt;value&gt;&color=&lt;color&gt;&text=&lt;textColor&gt;&size=&lt;size&gt;</code></pre>
32 <ul>
33 <li><b>url</b> (optional): Website to fetch favicon from</li>
34 <li><b>label</b> (optional): Left text (default: 'huy' if both label and value are missing)</li>
35 <li><b>value</b> (optional): Right text (default: 'hieu' if both label and value are missing)</li>
82 const urlObj = new URL(siteUrl)
83 const faviconUrl = `${urlObj.origin}/favicon.ico`
84 const res = await fetch(faviconUrl)
85 if (res.ok) {
86 const buffer = new Uint8Array(await res.arrayBuffer())
89 }
90 } catch {
91 console.error('HuyHieu: Failed to fetch favicon:', siteUrl)
92 }
93 }
145})
146
147export default app.fetch
148// Serve the app in local to test
149Deno.serve(app.fetch)
150

cardamonparse.ts3 matches

@connnolly•Updated 2 hours ago
166 const { content: url } = await c.req.json() as ParseRequest;
167
168 // Fetch the webpage content
169 const response = await fetch(url);
170 if (!response.ok) {
171 return c.json({ success: false, error: "Failed to fetch URL" } as ParseResponse);
172 }
173

cardamonval-town.mdc3 matches

@connnolly•Updated 2 hours ago
221
222 // Inject data to avoid extra round-trips
223 const initialData = await fetchInitialData();
224 const dataScript = `<script>
225 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
268
2695. **API Design:**
270 - `fetch` handler is the entry point for HTTP vals
271 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
272
2736. **Hono Peculiarities:**

strategoindex.ts3 matches

@gueejla•Updated 5 hours ago
101 const path = join(__dirname, "../frontend", c.req.path);
102 try {
103 return await c.env.ASSETS.fetch(new Request(c.req.url));
104 } catch (e) {
105 return next();
109// Start the server
110const server = serve({
111 fetch: app.fetch,
112 port,
113}, (info: { port: number }) => {
124});
125
126export default app.fetch;

val-town-http-mcp-servervalley.txt3 matches

@nbbaier•Updated 7 hours ago
230
231 // Inject data to avoid extra round-trips
232 const initialData = await fetchInitialData();
233 const dataScript = `<script>
234 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
277
2785. **API Design:**
279 - `fetch` handler is the entry point for HTTP vals
280 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
281
282## Val Town MCP Tools

val-town-http-mcp-servertownie.txt2 matches

@nbbaier•Updated 7 hours 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> {

val-town-http-mcp-serveropentownie.txt5 matches

@nbbaier•Updated 7 hours ago
77```
78
795. **fetchTranspiledJavaScript** - Fetch and transpile TypeScript to JavaScript:
80```ts
81const jsCode = await fetchTranspiledJavaScript("https://esm.town/v/username/project/path/to/file.ts");
82```
83
206
207 // Inject data to avoid extra round-trips
208 const initialData = await fetchInitialData();
209 const dataScript = `<script>
210 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
264
2655. **API Design:**
266 - `fetch` handler is the entry point for HTTP vals
267 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
268 - Properly handle CORS if needed for external access
269

FetchBasic2 file matches

@ther•Updated 6 days ago

GithubPRFetcher

@andybak•Updated 1 week ago