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/?q=fetch&page=435&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 8361 results for "fetch"(2997ms)

serve_sslmain.tsx5 matches

@taras•Updated 3 months ago
54
55// Dynamically import the handler
56let fetchHandler;
57try {
58 // deno-lint-ignore unanalyzable-dynamic-import
59 const handlerModule = await import(args.handler);
60 if (!handlerModule?.default?.fetch) {
61 throw new Error(
62 "Handler module must export default {fetch...} like in https://docs.deno.com/api/deno/~/Deno.ServeDefaultExport",
63 );
64 }
65 fetchHandler = handlerModule.default.fetch;
66} catch (error) {
67 const errorMessage = error instanceof Error ? error.message : String(error);
96try {
97 console.log(`Starting server on port ${args.port}...`);
98 await Deno.serve({ cert, key, port, reusePort: true }, fetchHandler);
99} catch (error) {
100 if (error instanceof Deno.errors.PermissionDenied) {

cerebras_codermain.tsx1 match

@nirajgupta•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@sanjay_9•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

neatBlackSwiftmain.tsx1 match

@druv33•Updated 3 months ago
183
184 try {
185 const response = await fetch("/", {
186 method: "POST",
187 body: JSON.stringify({

cerebras_codermain.tsx1 match

@druv33•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@amanchandii•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@kaze•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@CerebrasCoder•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

readmeManagermain.tsx3 matches

@postpostscript•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/hono/jsx */
2
3import { fetchPaginatedData } from "https://esm.town/v/nbbaier/fetchPaginatedData?v=49";
4import { api } from "https://esm.town/v/pomdtr/api?v=12";
5import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
182 authenticated: true,
183 });
184 const vals = await fetchPaginatedData(`${API_URL}/v1/users/${id}/vals`, {
185 headers: {
186 Authorization: `Bearer ${Deno.env.get("valtown")}`,
256});
257
258export default app.fetch;
259

openaiproxymain.tsx2 matches

@std•Updated 4 months ago
27 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
28 const token = authHeader ? parseBearerString(authHeader) : undefined;
29 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
30 if (!meRes.ok) {
31 return new Response("Unauthorized", { status: 401 });
63 });
64
65 const openAIRes = await fetch(url, {
66 method: req.method,
67 headers,

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago