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=api&page=192&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 17726 results for "api"(2161ms)

job-posting-and-chatroomindex.ts3 matches

@Iykeโ€ขUpdated 1 day ago
15await runMigrations();
16
17// API routes
18app.route("/api/jobs", jobs);
19app.route("/api/chat", chat);
20
21// Serve static files

job-posting-and-chatroomChatRoom.tsx2 matches

@Iykeโ€ขUpdated 1 day ago
19 const fetchMessages = async () => {
20 try {
21 const response = await fetch('/api/chat/messages');
22 if (!response.ok) throw new Error('Failed to fetch messages');
23 const messagesData = await response.json();
74 };
75
76 const response = await fetch('/api/chat/messages', {
77 method: 'POST',
78 headers: {

Mind_clinicjournal.ts6 matches

@andym42โ€ขUpdated 1 day ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import type { ApiResponse, JournalEntry } from "../../shared/types.ts";
3import {
4 createJournalEntry,
16 const limit = parseInt(c.req.query("limit") || "20");
17 const entries = await getRecentJournalEntries(limit);
18 return c.json({ success: true, data: entries } as ApiResponse<JournalEntry[]>);
19 } catch (error) {
20 return c.json({ success: false, error: error.message }, 500);
27 const id = parseInt(c.req.param("id"));
28 const entry = await getJournalEntryById(id);
29 return c.json({ success: true, data: entry } as ApiResponse<JournalEntry>);
30 } catch (error) {
31 if (error.message === 'Journal entry not found') {
68 });
69
70 return c.json({ success: true, data: entry } as ApiResponse<JournalEntry>);
71 } catch (error) {
72 return c.json({ success: false, error: error.message }, 500);
91
92 const entry = await updateJournalEntry(id, body);
93 return c.json({ success: true, data: entry } as ApiResponse<JournalEntry>);
94 } catch (error) {
95 if (error.message === 'Journal entry not found') {
105 const id = parseInt(c.req.param("id"));
106 await deleteJournalEntry(id);
107 return c.json({ success: true } as ApiResponse<null>);
108 } catch (error) {
109 return c.json({ success: false, error: error.message }, 500);

job-posting-and-chatroomJobForm.tsx1 match

@Iykeโ€ขUpdated 1 day ago
28
29 try {
30 const response = await fetch('/api/jobs', {
31 method: 'POST',
32 headers: {

Mind_clinicmood.ts6 matches

@andym42โ€ขUpdated 1 day ago
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import type { ApiResponse, MoodEntry } from "../../shared/types.ts";
3import {
4 createMoodEntry,
15 try {
16 const stats = await getMoodStats();
17 return c.json({ success: true, data: stats } as ApiResponse<typeof stats>);
18 } catch (error) {
19 return c.json({ success: false, error: error.message }, 500);
26 const limit = parseInt(c.req.query("limit") || "30");
27 const entries = await getRecentMoodEntries(limit);
28 return c.json({ success: true, data: entries } as ApiResponse<MoodEntry[]>);
29 } catch (error) {
30 return c.json({ success: false, error: error.message }, 500);
42 }
43
44 return c.json({ success: true, data: entry } as ApiResponse<MoodEntry>);
45 } catch (error) {
46 return c.json({ success: false, error: error.message }, 500);
95 }
96
97 return c.json({ success: true, data: entry } as ApiResponse<MoodEntry>);
98 } catch (error) {
99 return c.json({ success: false, error: error.message }, 500);
119
120 const entry = await updateMoodEntry(id, body);
121 return c.json({ success: true, data: entry } as ApiResponse<MoodEntry>);
122 } catch (error) {
123 if (error.message === 'Mood entry not found') {

job-posting-and-chatroomJobBoard.tsx1 match

@Iykeโ€ขUpdated 1 day ago
13 try {
14 setLoading(true);
15 const response = await fetch('/api/jobs');
16 if (!response.ok) throw new Error('Failed to fetch jobs');
17 const jobsData = await response.json();

Mind_clinictypes.ts1 match

@andym42โ€ขUpdated 1 day ago
44}
45
46export interface ApiResponse<T> {
47 success: boolean;
48 data?: T;

Mind_clinicREADME.md2 matches

@andym42โ€ขUpdated 1 day ago
39## Technology Stack
40
41- **Backend**: Hono (TypeScript API framework)
42- **Frontend**: React with TypeScript
43- **Database**: SQLite for data persistence
47## Getting Started
48
49This app is designed to run on Val Town. The backend serves both API endpoints and the frontend application.
50
51## Privacy & Security

job-posting-and-chatroomREADME.md7 matches

@Iykeโ€ขUpdated 1 day ago
17โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions
18โ”‚ โ”œโ”€โ”€ routes/
19โ”‚ โ”‚ โ”œโ”€โ”€ jobs.ts # Job posting API routes
20โ”‚ โ”‚ โ””โ”€โ”€ chat.ts # Chat API routes
21โ”‚ โ””โ”€โ”€ index.ts # Main Hono server
22โ”œโ”€โ”€ frontend/
32```
33
34## API Endpoints
35
36- `GET /api/jobs` - Get all job postings
37- `POST /api/jobs` - Create a new job posting
38- `GET /api/chat/messages` - Get chat messages
39- `POST /api/chat/messages` - Send a chat message
40
41## Getting Started

untitled-8502App.tsx2 matches

@clarejoanโ€ขUpdated 1 day ago
20 const fetchCompanies = async () => {
21 try {
22 const response = await fetch('/api/companies');
23 if (response.ok) {
24 const data = await response.json();
34 const handleCompanySelect = async (companyId: number) => {
35 try {
36 const response = await fetch(`/api/companies/${companyId}`);
37 if (response.ok) {
38 const company = await response.json();

RandomQuoteAPI

@Freelzyโ€ขUpdated 1 day ago

HAPI7 file matches

@dIgitalfulusโ€ขUpdated 1 day ago
Kapil01
apiv1