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/$%7Burl%7D?q=fetch&page=1115&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 13040 results for "fetch"(4082ms)

Queriesmain.tsx1 match

@iamseeley•Updated 1 year ago
2import { blob } from "https://esm.town/v/std/blob";
3
4// Fetch user by username
5export async function getUserByUsername(username: string) {
6 const userResult = await sqlite.execute({

profileHandlersmain.tsx1 match

@iamseeley•Updated 1 year ago
20 return c.html(<EditProfilePage user={user} />);
21 } catch (error) {
22 console.error("Error fetching user:", error);
23 return c.html(
24 <RootLayout>

blob_adminmain.tsx2 matches

@iamseeley•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
133});
134
135export default modifyFetchHandler(passwordAuth(app.fetch));

Server2main.tsx1 match

@iamseeley•Updated 1 year ago
93});
94
95export default app.fetch;

createValmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export interface ValResponse {
30
31export function createVal({ token, ...data }: { token?: string } & CreateValArgs): Promise<ValResponse> {
32 return fetchJSON("https://api.val.town/v1/vals", {
33 bearer: token || Deno.env.get("valtown"),
34 method: "PUT",

hono_react_ssrmain.tsx1 match

@stevekrouse•Updated 1 year ago
23 const onData = onSubmit ? onSubmit(e) : () => 1;
24 const formData = new FormData(e.target as any);
25 const resp = await fetch("/", {
26 method: props.action ?? "POST",
27 body: formData,

staticChessmain.tsx2 matches

@bjenhamin4alfredolvchenki•Updated 1 year ago
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 if (new URL(req.url).pathname === "/robots.txt") {
14 return new Response("User-agent: Amazonbot\nDisallow: /\n\nUser-agent: *\nAllow: /");
231const sc = new StaticChess();
232
233export default sc.fetch.bind(sc);

getWeathermain.tsx2 matches

@richardkaplan•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
6

blobImagesmain.tsx2 matches

@jdan•Updated 1 year ago
8
9function esmTown(url) {
10 return fetch(url, {
11 headers: {
12 "User-Agent":
17
18const app = new Hono();
19export default app.fetch;
20
21app.get("/", async (c) =>

blobImagesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
8
9function esmTown(url) {
10 return fetch(url, {
11 headers: {
12 "User-Agent":
17
18const app = new Hono();
19export default app.fetch;
20
21app.get("/", async (c) =>

fetch-socials4 file matches

@welson•Updated 2 days ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 3 days ago