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=191&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 17622 results for "api"(1380ms)

ALX_PJ1index.ts3 matches

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

ALX_PJ1ChatRoom.tsx2 matches

@thetechieguyโ€ขUpdated 1 day ago
18 const fetchMessages = async () => {
19 try {
20 const response = await fetch('/api/chat/messages');
21 if (response.ok) {
22 const messagesData = await response.json();
54 };
55
56 const response = await fetch('/api/chat/messages', {
57 method: 'POST',
58 headers: {

ALX_PJ1JobForm.tsx1 match

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

ALX_PJ1JobBoard.tsx1 match

@thetechieguyโ€ขUpdated 1 day ago
11 const fetchJobs = async () => {
12 try {
13 const response = await fetch('/api/jobs');
14 if (response.ok) {
15 const jobsData = await response.json();

telegramBotStarterindex.ts1 match

@tigrankโ€ขUpdated 1 day ago
38 // This is a no-op if nothing's changed
39 if (!isEndpointSet) {
40 await bot.api.setWebhook(req.url, {
41 secret_token: SECRET_TOKEN,
42 });

untitled-6073index.ts2 matches

@Jassyโ€ขUpdated 1 day ago
15await createTables();
16
17// API routes
18app.route("/api/items", itemsRouter);
19
20// Serve static files

untitled-6073App.tsx9 matches

@Jassyโ€ขUpdated 1 day ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect } from "https://esm.sh/react@18.2.0";
3import type { GroceryItem, CreateGroceryItem, ApiResponse } from "../../shared/types.ts";
4import GroceryItemComponent from "./GroceryItem.tsx";
5import AddItemForm from "./AddItemForm.tsx";
29 setError(null);
30 try {
31 const response = await fetch("/api/items");
32 const result: ApiResponse<GroceryItem[]> = await response.json();
33
34 if (result.success && result.data) {
46 const addItem = async (newItem: CreateGroceryItem) => {
47 try {
48 const response = await fetch("/api/items", {
49 method: "POST",
50 headers: { "Content-Type": "application/json" },
52 });
53
54 const result: ApiResponse<GroceryItem> = await response.json();
55
56 if (result.success && result.data) {
66 const updateItem = async (id: number, updates: Partial<GroceryItem>) => {
67 try {
68 const response = await fetch(`/api/items/${id}`, {
69 method: "PUT",
70 headers: { "Content-Type": "application/json" },
72 });
73
74 const result: ApiResponse<GroceryItem> = await response.json();
75
76 if (result.success && result.data) {
88 const deleteItem = async (id: number) => {
89 try {
90 const response = await fetch(`/api/items/${id}`, {
91 method: "DELETE",
92 });
93
94 const result: ApiResponse<any> = await response.json();
95
96 if (result.success) {

untitled-6073types.ts1 match

@Jassyโ€ขUpdated 1 day ago
24}
25
26export interface ApiResponse<T> {
27 success: boolean;
28 data?: T;

untitled-6073README.md7 matches

@Jassyโ€ขUpdated 1 day ago
21โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database operations
22โ”‚ โ”œโ”€โ”€ routes/
23โ”‚ โ”‚ โ””โ”€โ”€ items.ts # Grocery items API routes
24โ”‚ โ””โ”€โ”€ index.ts # Main Hono server
25โ”œโ”€โ”€ frontend/
34```
35
36## API Endpoints
37
38- `GET /api/items` - Get all grocery items
39- `POST /api/items` - Create a new item
40- `PUT /api/items/:id` - Update an item
41- `DELETE /api/items/:id` - Delete an item
42
43## Getting Started
44
45This app runs on Val Town. The backend serves the frontend and provides a REST API for managing grocery items.

untitled-4247README.md12 matches

@Jassyโ€ขUpdated 1 day ago
53The app is automatically deployed on Val Town. Access the main endpoint to start using the expense tracker.
54
55## API Endpoints
56
57- `POST /api/auth/signup` - User registration
58- `POST /api/auth/login` - User login
59- `POST /api/auth/logout` - User logout
60- `GET /api/auth/me` - Get current user
61- `GET /api/transactions` - Get user transactions
62- `POST /api/transactions` - Create transaction
63- `PUT /api/transactions/:id` - Update transaction
64- `DELETE /api/transactions/:id` - Delete transaction
65- `GET /api/budgets` - Get user budgets
66- `POST /api/budgets` - Create/update budget
67- `GET /api/dashboard` - Get dashboard summary

RandomQuoteAPI

@Freelzyโ€ขUpdated 23 hours ago

HAPI7 file matches

@dIgitalfulusโ€ขUpdated 1 day ago
Kapil01
apiv1