You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Burl%7D?q=api&page=44&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 11715 results for "api"(1136ms)
275==========================*/
276// The server function remains the same as in the previous single-file solution,
277// as it handles API requests and serves the main HTML.
278// Its logic is independent of how the client-side components are structured into files.
279export default async function server(
327const method = request.method;
328329// API Routes (same logic as before)
330if (path === "/login" && method === "POST") {
331const body = await request.json();
444}
445446// API endpoint to handle editing a news article
447if (path === "/edit-news" && method === "PUT") {
448try {
569}
570571// --- End Media Monitoring Specific API Routes ---
572// --- NEW ENDPOINT: Generate Weekly Summary ---
573if (path === "/generate-weekly-summary" && method === "GET") {
1import process from "node:process";
2import { BskyAgent } from "npm:@atproto/api";
3import fetch from "npm:node-fetch";
4import * as cheerio from "npm:cheerio";