You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bsuccess?q=fetch&page=6&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=fetch
Returns an array of strings in format "username" or "username/projectName"
Found 8124 results for "fetch"(996ms)
79}
8081// If there are selected files, fetch their content and add them to the messages
82if (selectedFiles && selectedFiles.length > 0) {
83const vt = new ValTown({ bearerToken });
99fileContents += `## File: ${filePath}\n\`\`\`\n${fileWithLinesNumbers(content)}\n\`\`\`\n\n`;
100} catch (error) {
101console.error(`Error fetching file ${filePath}:`, error);
102fileContents += `## File: ${filePath}\nError: Could not fetch file content\n\n`;
103}
104}
15// replace all this with oauth when it's ready
16try {
17const res = await fetch("/api/user", {
18headers: {
19"Authorization": "Bearer " + valTownAPIKey,