You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bsuccess?q=api&page=25&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 11605 results for "api"(800ms)
327328// ============================================================
329// TELEGRAM API INTERACTION
330// ============================================================
331332/**
333* Send a message using the Telegram API
334*/
335async function sendTelegramMessage(chatId, text) {
337const botToken = process.env.TELEGRAM_BOT_TOKEN;
338339const response = await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {
340method: "POST",
341headers: { "Content-Type": "application/json" },
367const botToken = process.env.TELEGRAM_BOT_TOKEN;
368369const response = await fetch(`https://api.telegram.org/bot${botToken}/setWebhook`, {
370method: "POST",
371headers: { "Content-Type": "application/json" },
391const botToken = process.env.TELEGRAM_BOT_TOKEN;
392393const response = await fetch(`https://api.telegram.org/bot${botToken}/getWebhookInfo`);
394const result = await response.json();
395return result;
264==========================*/
265// The server function remains the same as in the previous single-file solution,
266// as it handles API requests and serves the main HTML.
267// Its logic is independent of how the client-side components are structured into files.
268export default async function server(
316const method = request.method;
317318// API Routes (same logic as before)
319if (path === "/login" && method === "POST") {
320const body = await request.json();