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=47&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 8567 results for "fetch"(913ms)

morningmailmain.tsx1 match

@flymaster•Updated 1 week ago
18
19async function wikitext(): string {
20 const randomArticle = await fetch(
21 "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&exintro&explaintext&redirects=1&generator=random&formatversion=2&grnnamespace=0&grnlimit=3",
22 );

TownieuseAuth.tsx1 match

@valdottown•Updated 1 week ago
15 // replace all this with oauth when it's ready
16 try {
17 const res = await fetch("/api/user", {
18 headers: {
19 "Authorization": "Bearer " + valTownAPIKey,

helloooooooindex.ts1 match

@charmaine•Updated 1 week ago
129
130// This is the entry point for HTTP vals
131export default app.fetch;

helloooooooindex.html2 matches

@charmaine•Updated 1 week ago
116 posts = window.INITIAL_DATA.posts;
117 } else {
118 const response = await fetch('/api/posts');
119 posts = await response.json();
120 }
156
157 try {
158 const response = await fetch(`/api/posts/${params.slug}`);
159
160 if (!response.ok) {

sqliteExplorerApp2main.tsx4 matches

@shouser•Updated 1 week ago
1/** @jsxImportSource npm:hono/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

blogggggindex.ts1 match

@charmaine•Updated 1 week ago
167}
168
169export default app.fetch;

TownieTODOs.md1 match

@valdottown•Updated 1 week ago
47<!--
48
49- [x] refetch project data on create/etc
50- [x] Loading favicon
51- [x] Ensure main branch is default selected

Townietext-editor.ts1 match

@valdottown•Updated 1 week ago
136 let type_: "file" | "http" | "script";
137 if (path.includes("backend/index.ts")) type_ = "http";
138 if (file_text?.includes("export default app.fetch")) type_ = "http";
139 if ([".ts", ".tsx", ".js", ".jsx"].some(ext => path.endsWith(ext))) {
140 type_ = "script";

TownieLayoutRoute.tsx1 match

@valdottown•Updated 1 week ago
4
5export function LayoutRoute () {
6 // TODO fetch here because we're not doing any caching
7 // and we want the user data in the header ?
8 // const projects = useProjects();

Townieindex.ts1 match

@valdottown•Updated 1 week ago
21
22// This is the entry point for HTTP vals
23export default app.fetch;
24

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago