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/%22script.js/%22https:/github.com/editor-js//%22/val/$%7Busage.val_id%7D/%22?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 19125 results for "fetch"(1434ms)

epic-games-free-gamesmain.ts1 match

@gmcabrita•Updated 10 mins ago
13 });
14
15 const response = await fetch(
16 "https://store-site-backend-static-ipv4.ak.epicgames.com/freeGamesPromotions?locale=en-US&country=PT&allowCountries=PT",
17 );

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

@charmaine•Updated 14 mins 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

@charmaine•Updated 14 mins 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

@charmaine•Updated 14 mins 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

val-town-http-mcp-serverindex.http.ts4 matches

@charmaine•Updated 14 mins ago
11import {Hono} from "npm:hono"
12import {cors} from "npm:hono/cors"
13import {toFetchResponse, toReqRes} from "npm:fetch-to-node"
14import {registerPromptsTools, registerTools} from "./registerTools.ts"
15import {loadConfig} from "./config.ts"
106 })
107
108 // Convert Node.js response back to Fetch response
109 return toFetchResponse(res)
110
111 } catch (error) {
131})
132
133export default app.fetch

val-town-http-mcp-serverfileTools.ts1 match

@charmaine•Updated 14 mins ago
196 }
197
198 const response = await fetch(
199 `${config.apiBase}/v2/vals/${valId}/files/content${queryParams}`,
200 {

val-town-http-mcp-serverblobTools.ts2 matches

@charmaine•Updated 14 mins ago
42 // For blobs, we need to handle binary data differently
43 const url = `${config.apiBase}/v1/blob/${encodeURIComponent(key)}`
44 const response = await fetch(url, {
45 headers: {
46 "Authorization": `Bearer ${config.apiToken}`,
110
111 const url = `${config.apiBase}/v1/blob/${encodeURIComponent(key)}`
112 const response = await fetch(url, {
113 method: "POST",
114 headers: {

val-town-http-mcp-serverapi.ts1 match

@charmaine•Updated 14 mins ago
29 }
30
31 const response = await fetch(url, {
32 ...options,
33 headers: {
Gemini-Nano-Banana-03

Gemini-Nano-Banana-03main.tsx2 matches

@aibotcommander•Updated 28 mins ago
116): Promise<void> {
117 try {
118 const response = await fetch("https://openrouter.ai/api/v1/chat/completions", {
119 method: "POST",
120 headers: {
197 const url = `${IMAGE_MODEL.endpoint}?key=${process.env.GEMINI_API_KEY}`;
198
199 const response = await fetch(url, {
200 method: "POST",
201 headers: IMAGE_MODEL.headers,

zoomtestmain.js7 matches

@yawnxyz•Updated 29 mins ago
68 const credentials = btoa(`${ZOOM_CLIENT_ID}:${ZOOM_CLIENT_SECRET}`);
69
70 const response = await fetch(tokenUrl, {
71 method: "POST",
72 headers: {
92 const credentials = btoa(`${ZOOM_CLIENT_ID}:${ZOOM_CLIENT_SECRET}`);
93
94 const response = await fetch(tokenUrl, {
95 method: "POST",
96 headers: {
1028 oauthStatusBtn.addEventListener('click', async () => {
1029 try {
1030 const response = await fetch('/oauth/status');
1031 const status = await response.json();
1032
1069 rtmsStatusBtn.addEventListener('click', async () => {
1070 try {
1071 const response = await fetch('/oauth/status'); // Reuse OAuth status for now
1072 const status = await response.json();
1073
1120 };
1121
1122 const response = await fetch('/webhook', {
1123 method: 'POST',
1124 headers: {
1267
1268 try {
1269 const response = await fetch('https://openrouter.ai/api/v1/chat/completions', {
1270 method: 'POST',
1271 headers: {
1607app.route('/analysis', analysisApp);
1608
1609export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
1610
bible

bible2 file matches

@cameronpak•Updated 4 hours ago
fetch(bible) - one-liner Bible reader

FetchBasic2 file matches

@bengold•Updated 2 weeks ago