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=551&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 25394 results for "api"(5919ms)

Glimpseaction.controller.ts1 match

@glanceโ€ขUpdated 2 months ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

Glimpseaction.controller.ts1 match

@lightweightโ€ขUpdated 2 months ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

GlimpseREADME.md11 matches

@lightweightโ€ขUpdated 2 months ago
17 let html = await readFile("/frontend/index.html", import.meta.url);
18
19 const response = await fetch(`/api/demo/${id}`);
20 const initialData = await response.json();
21
87// Client-side event recording
88window.recordClick = function (action) {
89 fetch(`/api/setAction`, {
90 method: "POST",
91 headers: { "Content-Type": "application/json" },
103
104```
105โ”œโ”€โ”€ backend/ # Server-side logic and API routes
106โ”‚ โ”œโ”€โ”€ controllers/ # Business logic for Notion integration
107โ”‚ โ”œโ”€โ”€ crons/ # Scheduled tasks for cache management
108โ”‚ โ”œโ”€โ”€ routes/ # HTTP route handlers
109โ”‚ โ”‚ โ”œโ”€โ”€ api/ # JSON API endpoints
110โ”‚ โ”‚ โ”œโ”€โ”€ tasks/ # Notion webhook handlers
111โ”‚ โ”‚ โ””โ”€โ”€ views/ # HTML page serving
121### Backend (`/backend`)
122
123Handles all server-side operations including API routes, Notion integration, and static file serving. Built with Hono for routing and includes authentication middleware.
124
125### Frontend (`/frontend`)
134
135- **Val Town & Deno**: Serverless runtime environment with TypeScript support
136- **Notion Client**: Official npm library for Notion API integration
137- **Hono**: Lightweight web framework for routing and middleware
138- **Blob Storage**: Val Town's built-in caching solution for performance optimization
170
171// Route modules
172app.route("/api", api); // JSON API endpoints
173app.route("/tasks", tasks); // Notion webhook handlers
174app.route("/demo", demo); // Demo page serving
175```
176
177#### API Routes (`/api`)
178
179Serve JSON data and handle CRUD operations for demo management, cobrowsing status, and user interactions.
241```typescript
242const notion = new Client({
243 auth: Deno.env.get("NOTION_API_KEY"),
244});
245
249Required environment variables:
250
251- `NOTION_API_KEY`: Notion integration token
252- `GLANCE_DEMOS_DB_ID`: Notion database ID for demo pages
253- `GLANCE_INTERACTIONS_DB_ID`: Notion database ID for interaction tracking
289Different route areas serve specific purposes:
290
291- `/api/*`: JSON data endpoints for frontend consumption
292- `/demo/*`: Personalized demo page serving with data injection
293- `/tasks/*`: Notion webhook processing and database updates

GlimpsepollEnabledStatus.ts1 match

@lightweightโ€ขUpdated 2 months ago
12
13 // check the boolean to see if a Glimpse has enabled the link to start a cobrowsing session
14 const resp = await fetch("/api/cobrowse/" + window.__DEMO_ID__, {
15 method: "GET",
16 headers: {

GlimpseINSTRUCTIONS.md1 match

@lightweightโ€ขUpdated 2 months ago
37- Hono /backend/routes, including
38 - index.ts and what it does, and the routing strategy it establishes, including
39 - /api routes for serving JSON and other content to views
40 - /view routes for serving the demo at /demo/:id/
41 - /task routes for handling Notion webhooks

Glimpseactions.api.routes.ts0 matches

@lightweightโ€ขUpdated 2 months ago
1import { Hono } from "npm:hono";
2import {
3 getDemoInteractions,
4 getAllInteractionsPages,
5} from "../../controllers/actions.controller.ts";

Glimpseactions.controller.ts1 match

@lightweightโ€ขUpdated 2 months ago
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7

Glimpsecobrowse.api.routes.ts0 matches

@lightweightโ€ขUpdated 2 months ago
1import { blob } from "https://esm.town/v/std/blob?v=12";
2import { Hono } from "npm:hono";
3import { blobKeyForDemoCobrowseStatus } from "../../../shared/utils/blobKeyForDemoCobrowseStatus.ts";
4
5const app = new Hono();

GlimpserelatedPages.controller.ts1 match

@lightweightโ€ขUpdated 2 months ago
4// Initialize Notion client
5const notion = new Client({
6 auth: Deno.env.get("NOTION_API_KEY"),
7});
8

GlimpsedemoCobrowseStatus.ts1 match

@lightweightโ€ขUpdated 2 months ago
5// Initialize Notion client
6const notion = new Client({
7 auth: Deno.env.get("NOTION_API_KEY"),
8});
9

weatherApp1 file match

@dcm31โ€ขUpdated 6 hours ago
A simple weather app with dropdown cities using Open-Meteo API

integrate-api-nvidia-com-v1-chat-completions3 file matches

@curtcoxโ€ขUpdated 6 hours ago
fapian
<("<) <(")> (>")>
Kapil01