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/$%7Bsuccess?q=fetch&page=673&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 8792 results for "fetch"(1140ms)

dateme_home_reactmain.tsx1 match

@stevekrouse•Updated 11 months ago
14async function reverseGeocodeNominat(lat, lng) {
15 const url = `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&zoom=13`;
16 const response = await fetch(url);
17 const json = await response.json();
18 return json;

dailyDadJokemain.tsx2 matches

@doublelotus•Updated 11 months ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 console.log(setup, punchline);
7 return email({

dateme_routermain.tsx2 matches

@stevekrouse•Updated 11 months ago
14// Generic loader that forwards on requests for that page's JSON data
15function loader({ request }) {
16 return fetch(request, {
17 headers: {
18 "Content-Type": "application/json",
24function action({ request }) {
25 if (request.method === "GET") { throw Error("GET not expected here - something is wrong."); }
26 return fetch(request);
27}
28

valceptionmain.tsx1 match

@iamseeley•Updated 11 months ago
54});
55
56export default app.fetch;
57

fuchsiaSnipemain.tsx1 match

@tmcw•Updated 11 months ago
1export default async function(req: Request): Promise<Response> {
2 const response = await fetch("http://worldtimeapi.org/api/timezone/America/New_York")
3 const timeData = await response.json()
4

resumeConfigmain.tsx1 match

@ajax•Updated 11 months ago
5
6export const resumeConfig = {
7 // URL to fetch the resume JSON data. This should point to your raw resume JSON.
8 // If you want to host your resume JSON somewhere I recommend a setup like this on val town (https://www.val.town/v/iamseeley/resumeDetails) or a github gist.
9 // You can test out the resume view using my resume: https://iamseeley-resumedetails.web.val.run

imageMagickWasmExamplemain.tsx1 match

@maxm•Updated 11 months ago
7} from "https://esm.sh/@imagemagick/magick-wasm";
8
9const resp = await fetch("https://esm.sh/@imagemagick/magick-wasm@0.0.29/dist/magick.wasm");
10const wasmBytes = await resp.arrayBuffer();
11

nestedValmain.tsx1 match

@iamseeley•Updated 11 months ago
10 );
11});
12export default app.fetch;

formLogicmain.tsx1 match

@iamseeley•Updated 11 months ago
119 };
120
121 const response = await fetch('/generate-image', {
122 method: 'POST',
123 headers: {

cmdk_commandmain.tsx8 matches

@pomdtr•Updated 11 months ago
1#!/usr/bin/env -S deno serve --allow-all --env --watch
2
3import { fetchAPI } from "https://esm.town/v/pomdtr/fetchAPI?v=4";
4import { Hono } from "npm:hono";
5
8
9app.get("/", async (c) => {
10 const resp = await fetchAPI("/v1/me", {
11 token,
12 });
51app.get("/vals/list", async (c) => {
52 const userID = c.req.query("user");
53 const resp = await fetchAPI(`/v1/users/${userID}/vals`, {
54 token,
55 paginate: true,
103app.get("/vals/view", async (c) => {
104 const valID = c.req.query("val");
105 const resp = await fetchAPI(`/v1/vals/${valID}`, {
106 token,
107 });
128 const { name, code, privacy, type, val } = await c.req.json();
129
130 await fetchAPI(`/v1/vals/${val}`, {
131 method: "PATCH",
132 token,
200 const { name, code, privacy, type } = await c.req.json();
201
202 const resp = await fetchAPI("/v1/vals", {
203 method: "POST",
204 token,
271app.post("/vals/delete", async (c) => {
272 const { reload, val } = await c.req.json();
273 const resp = await fetchAPI(`/v1/vals/${val}`, {
274 method: "DELETE",
275 token,
294});
295
296export default app.fetch;

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago