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=database&page=1&format=json

For typeahead suggestions, use the /typeahead endpoint:

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

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

Found 7799 results for "database"(2451ms)

No matches found in users.

Try switching to another result type using the tabs above.

cardamomindex.ts10 matches

@connnolly•Updated 1 hour ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils/index.ts";
3import { runMigrations } from "./database/migrations.ts";
4import recipesApp from "./routes/recipes.ts";
5import parseApp from "./routes/parse.ts";
13});
14
15// Initialize database on startup
16let dbInitialized = false;
17async function initializeDatabase() {
18 if (!dbInitialized) {
19 try {
20 await runMigrations();
21 dbInitialized = true;
22 console.log('Database initialized successfully');
23 } catch (error) {
24 console.error('Failed to initialize database:', error);
25 throw error;
26 }
31app.get('/api/health', async (c) => {
32 try {
33 await initializeDatabase();
34 return c.json({ status: 'ok', timestamp: new Date().toISOString() });
35 } catch (error) {
40// Test endpoint for debugging delete operations
41app.get('/api/test-delete', async (c) => {
42 await initializeDatabase();
43 return c.json({ message: 'Delete test endpoint - check logs for database operations' });
44});
45
53app.get("/shared/*", c => serveFile(c.req.path, import.meta.url));
54
55// Serve main HTML page with database initialization
56app.get("/", async (c) => {
57 try {
58 await initializeDatabase();
59 let html = await readFile("/frontend/index.html", import.meta.url);
60

luciaMagicLinkStarterREADME.md1 match

@shapedlines•Updated 3 hours ago
25## Technical Implementation
26
27- **Database**:[Val Town SQLite](https://docs.val.town/std/sqlite/) for storing users, sessions, and magic link tokens
28- **Frontend**: React with Tailwind CSS
29- **Backend**: Hono.js for API routes and middleware

bookmarksDatabase

@s3thi•Updated 4 months ago

sqLiteDatabase1 file match

@ideofunk•Updated 7 months ago