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=600&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 8233 results for "fetch"(1549ms)

37
38export default async function main(req: Request): Promise<Response> {
39 // Fetch existing comments
40 let comments: string[] = await blob.getJSON(COMMENTS_KEY) || [];
41
36
37export default async function main(req: Request): Promise<Response> {
38 // Fetch existing comments
39 let comments: string[] = await blob.getJSON(COMMENTS_KEY) || [];
40
1// This code will create a simple comment box where users can submit a comment using an input field.
2// It will persist the comments using blob storage, and display all previous comments using a GET request to fetch comments.
3
4import { blob } from "https://esm.town/v/std/blob";
42});
43
44export default app.fetch;
45
61});
62
63export default app.fetch;
64
25 }
26
27 // Fetch current comments
28 const comments = await blob.getJSON<string[]>(key) ?? [];
29
30
31export default async function main(req: Request): Promise<Response> {
32 // Fetch existing comments
33 let comments: string[] = await blob.getJSON(COMMENTS_KEY) || [];
34
64});
65
66export default app.fetch;
67
58app.post("/comment", async c => {
59 const formData = await c.req.parseBody();
60 const text = formData.get('text'); // using get method to fetch the value
61
62 // Insert the comment into the database
67});
68
69export default app.fetch;
70
69});
70
71export default app.fetch;
72
71});
72
73export default app.fetch;
74
75

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago