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/$2?q=api&page=49&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 18047 results for "api"(497ms)

myApi1 file match

@shanemcgrath•Updated 1 year ago

myApi1 file match

@lstyr•Updated 1 year ago

myApi1 file match

@dubinets•Updated 1 year ago

myApi1 file match

@mrfabbri•Updated 1 year ago

myApi2 file matches

@piotr•Updated 1 year ago

myApi1 file match

@richardkaplan•Updated 1 year ago

myApi2 file matches

@michaelheckmann•Updated 1 year ago

myApi1 file match

@igor•Updated 1 year ago

myApi1 file match

@tech_aly•Updated 1 year ago

myApi1 file match

@danieledrisian•Updated 1 year ago
Gardenon

GardenonREADME.md10 matches

@Llad•Updated 1 hour ago
14- Admin panel for database management and inspection of both plants and settings tables
15
16## API Endpoints
17
18The application provides the following RESTful API endpoints:
19
20### Garden Settings
21
22#### GET /api/settings
23Returns the current garden configuration settings.
24
25#### PUT /api/settings
26Updates garden configuration settings. Required fields:
27- `garden_width`: Width of the garden map in pixels (300-2000)
30### Plants
31
32#### GET /api/plants
33Returns a list of all plants in the garden.
34
35### GET /api/plants/:id
36Returns details for a specific plant by ID.
37
38### POST /api/plants
39Creates a new plant. Required fields:
40- `x_coordinate`: X position on the map
46- `notes`: Additional information about the plant
47
48### PUT /api/plants/:id
49Updates an existing plant. All fields are optional.
50
51### DELETE /api/plants/:id
52Removes a plant from the garden.
53
106## Technologies Used
107
108- Hono.js for the API backend
109- SQLite for data storage
110- Vanilla JavaScript for the frontend
Gardenon

Gardenonindex.ts9 matches

@Llad•Updated 1 hour ago
49initDatabase();
50
51// API Routes
52// Get garden settings
53app.get("/api/settings", async (c) => {
54 const settingsResult = await sqlite.execute(`SELECT * FROM ${SETTINGS_TABLE_NAME} WHERE id = 1`);
55 return c.json(settingsResult.rows[0] || { garden_width: 800, garden_height: 500 });
57
58// Update garden settings
59app.put("/api/settings", async (c) => {
60 const body = await c.req.json();
61
82
83// Get all plants
84app.get("/api/plants", async (c) => {
85 const plantResults = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} ORDER BY id DESC`);
86 return c.json(plantResults.rows);
88
89// Get database info (for admin purposes)
90app.get("/api/admin/db", async (c) => {
91 // Get table schema for plants
92 const plantsSchema = await sqlite.execute(`PRAGMA table_info(${TABLE_NAME})`);
121
122// Get a specific plant
123app.get("/api/plants/:id", async (c) => {
124 const id = c.req.param("id");
125 const plants = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} WHERE id = ?`, [id]);
133
134// Create a new plant
135app.post("/api/plants", async (c) => {
136 const body = await c.req.json();
137
158
159// Update a plant
160app.put("/api/plants/:id", async (c) => {
161 const id = c.req.param("id");
162 const body = await c.req.json();
190
191// Delete a plant
192app.delete("/api/plants/:id", async (c) => {
193 const id = c.req.param("id");
194
Kapil01
apiv1