You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/image-url.jpg%20%22Optional%20title%22?q=api&page=42&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 11853 results for "api"(473ms)
14app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
1516// Add your API routes here
17// app.get("/api/data", c => c.json({ hello: "world" }));
1819// Unwrap and rethrow Hono errors as the original error
26}
2728const { messages, project, branchId, anthropicApiKey, selectedFiles, images } = await c.req.json();
29// console.log("Original messages:", JSON.stringify(messages, null, 2));
30// console.log("Images received:", JSON.stringify(images, null, 2));
3132const apiKey = anthropicApiKey || Deno.env.get("ANTHROPIC_API_KEY");
33const our_api_token = apiKey === Deno.env.get("ANTHROPIC_API_KEY");
3435if (our_api_token) {
36if (await overLimit(bearerToken)) {
37return Response.json("You have reached the limit of Townie in a 24 hour period.", { status: 403 });
4243const rowid = await startTrackingUsage({
44our_api_token,
45bearerToken, // will look up the userId from this
46branch_id: branchId,
5152const anthropic = createAnthropic({
53apiKey,
54});
55