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=api&page=11&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 19714 results for "api"(1661ms)

MiniAppStarterindex.tsx2 matches

@moeUpdated 1 day ago
21 }));
22
23app.get("/api/counter/get", async c => c.json(await db.get("counter")));
24app.get("/api/counter/increment", async c => c.json(await db.set("counter", (await db.get("counter") || 0) + 1)));
25
26app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));

MiniAppStarterApp.tsx3 matches

@moeUpdated 1 day ago
58 <div className="">✷ Farcaster mini app manifest + webhook + embed metadata</div>
59 <div className="">✷ Farcaster notifications (storing tokens, sending recurring notifications, ...)</div>
60 <div className="">✷ Neynar API integration for Farcaster data</div>
61 <div className="">✷ Hosted on Val Town (instant deployments on save)</div>
62 <div className="">
72
73function Database() {
74 const queryFn = () => fetch("/api/counter/get").then((r) => r.json());
75 const { data, refetch } = useQuery({ queryKey: ["counter"], queryFn });
76 return (
78 {/* <h2 className="font-semibold">Database Example</h2> */}
79 <div className="">Counter value: {data}</div>
80 <Button variant="outline" onClick={() => fetch("/api/counter/increment").then(refetch)}>
81 Increment
82 </Button>

MindfulMiles4-jueves.ts1 match

@profMoishUpdated 1 day ago
4 const TEXT = " Встерча и Работа ";
5
6 const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
7
8 fetch(url, {

MindfulMiles7-domingo.ts1 match

@profMoishUpdated 1 day ago
4 const TEXT = "🎨 Отдых";
5
6 const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
7
8 fetch(url, {

MindfulMiles6-sabado.ts1 match

@profMoishUpdated 1 day ago
4 const TEXT = "🤩 Служение и Семейное! ";
5
6 const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
7
8 fetch(url, {

MindfulMiles5-viernes.ts1 match

@profMoishUpdated 1 day ago
4 const TEXT = "👷‍♂️ Филиал ";
5
6 const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
7
8 fetch(url, {

MindfulMiles2-martes.ts1 match

@profMoishUpdated 1 day ago
4 const TEXT = "🏢🚨 Lunes Monday Филиал ";
5
6 const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
7
8 fetch(url, {

MindfulMiles3-miercoles.ts1 match

@profMoishUpdated 1 day ago
4 const TEXT = "🦺 Ezeiza";
5
6 const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
7
8 fetch(url, {

MindfulMiles1-lunes.ts1 match

@profMoishUpdated 1 day ago
4 const TEXT = "⏰ 8 часов работать";
5
6 const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
7
8 fetch(url, {

reactHonoExampleREADME.md5 matches

@gwoods22Updated 1 day ago
8## Hono
9
10This app uses [Hono](https://hono.dev/) as the API framework. You can think of Hono as a replacement for [ExpressJS](https://expressjs.com/) that works in serverless environments like Val Town or Cloudflare Workers. If you come from Python or Ruby, Hono is also a lot like [Flask](https://github.com/pallets/flask) or [Sinatra](https://github.com/sinatra/sinatra), respectively.
11
12## Serving assets to the frontend
20### `index.html`
21
22The most complicated part of this backend API is serving index.html. In this app (like most apps) we serve it at the root, ie `GET /`.
23
24We *bootstrap* `index.html` with some initial data from the server, so that it gets dynamically injected JSON data without having to make another round-trip request to the server to get that data on the frontend. This is a common pattern for client-side rendered apps.
25
26## CRUD API Routes
27
28This app has two CRUD API routes: for reading and inserting into the messages table. They both speak JSON, which is standard. They import their functions from `/backend/database/queries.ts`. These routes are called from the React app to refresh and update data.
29
30## Errors
31
32Hono and other API frameworks have a habit of swallowing up Errors. We turn off this default behavior by re-throwing errors, because we think most of the time you'll want to see the full stack trace instead of merely "Internal Server Error". You can customize how you want errors to appear.
Plantfo

Plantfo8 file matches

@LladUpdated 5 hours ago
API for AI plant info

scrapeCraigslistAPI1 file match

@shapedlinesUpdated 18 hours ago
apiry
snartapi