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=221&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 2444 results for "fetch"(364ms)

getProjectsAsZipsindex.ts3 matches

@shouser•Updated 1 month ago
131 if (failedFiles.length > 0) {
132 const failedFilesList = failedFiles.map(f => `'${f.path}': ${f.error}`).join(", ");
133 throw new Error(`Failed to fetch content for files: ${failedFilesList}`);
134 }
135
167});
168
169// HTTP vals expect an exported "fetch handler"
170// This is how you "run the server" in Val Town with Hono
171export default app.fetch;

replicate_starterindex.ts2 matches

@zeke•Updated 1 month ago
45});
46
47// HTTP vals expect an exported "fetch handler"
48// This is how you "run the server" in Val Town with Hono
49export default app.fetch;

replicate_starterindex.ts2 matches

@charmaine•Updated 1 month ago
46});
47
48// HTTP vals expect an exported "fetch handler"
49// This is how you "run the server" in Val Town with Hono
50export default app.fetch;

replicate_starterApp.tsx1 match

@charmaine•Updated 1 month ago
39 try {
40 setLoading(true);
41 const response = await fetch("/generate-image", {
42 method: "POST",
43 headers: {

replicate_starterApp.tsx1 match

@zeke•Updated 1 month ago
39 try {
40 setLoading(true);
41 const response = await fetch("/generate-image", {
42 method: "POST",
43 headers: {

PetconREADME.md1 match

@Zeeshanshaikh2•Updated 1 month ago
70 setError("");
71 try {
72 const response = await fetch("/api/adopt", {
73 method: "POST",
74 headers: {

feedbinStarsRSSFeedfeedbinAPI5 matches

@mcwhittemore•Updated 1 month ago
1import { rawFetch } from "https://esm.town/v/std/rawFetch";
2
3export async function getStars() {
4 return await feedbinFetch("https://api.feedbin.com/v2/starred_entries.json", {});
5}
6
7export function getEntry(entryId: number) {
8 return feedbinFetch(`https://api.feedbin.com/v2/entries/${entryId}.json`, {});
9}
10
11async function feedbinFetch(url: string, opts: any) {
12 try {
13 const username = Deno.env.get("FEEDBIN_USER");
16 opts.headers = opts.headers || {};
17 opts.headers["Authorization"] = "Basic " + btoa(username + ":" + password);
18 const res = await rawFetch(url, opts);
19 if (res.ok === false) {
20 console.log(res);
GitHubSync

GitHubSyncREADME.md4 matches

@jxnblk•Updated 1 month ago
12
13- `/push` will copy the contents from a list of vals specified in `config.json` and push them to a GitHub repo
14- `/deploy` is a GitHub webhook URL that will fetch contents from GitHub and update the code on Val Town
15
161. Fork this val
271. Add a `VAL_SECRET` env var to the val. Use this secret to sign the webhook POST request to the `/push` endpoint. Use this endpoint to commit vals from Val Town to your GitHub repo.
28
29### Example push to GitHub fetch
30
31You can use this example to POST to the `/push` endpoint to copy vals to GitHub.
46 const signature = await sign(body, secret);
47
48 const res = await fetch(url, {
49 method: "POST",
50 body,
89- [x] Monkey test
90- [x] Add setup instructions to readme
91- [x] Add example code for private webhook fetch
92- [x] Make val and repo public
93- [ ] Check modified date before export to GitHub??

replicate_starterindex.ts2 matches

@replicate•Updated 1 month ago
43});
44
45// HTTP vals expect an exported "fetch handler"
46// This is how you "run the server" in Val Town with Hono
47export default app.fetch;

replicate_starterApp.tsx1 match

@replicate•Updated 1 month ago
39 try {
40 setLoading(true);
41 const response = await fetch("/generate-image", {
42 method: "POST",
43 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 5 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago