You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$2?q=react&page=21&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=react
Returns an array of strings in format "username" or "username/projectName"
Found 12717 results for "react"(1358ms)
90
91<script type="module">
92/** @jsxImportSource https://esm.sh/react@18.2.0 */
93import React, { useState, useEffect, useRef } from 'https://esm.sh/react@18.2.0?deps=react@18.2.0';
94import { createRoot } from 'https://esm.sh/react-dom@18.2.0/client?deps=react@18.2.0,react-dom@18.2.0';
9596// Generate a simple user ID for this session
456// Render the app
457const root = createRoot(document.getElementById('root'));
458root.render(React.createElement(NanoCogApp));
459</script>
460</body>
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?deps=react@18.2.0";
3import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter?deps=react@18.2.0,react-dom@18.2.0";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5import STARTER_PROMPTS from "./starter-prompts.js";
630}: {
31prompt: string;
32setPrompt: React.Dispatch<React.SetStateAction<string>>;
33handleSubmit: (e: React.FormEvent) => void;
34handleStarterPromptClick: (promptItem: PromptItem) => void;
35}) {
116117function App() {
118const previewRef = React.useRef<HTMLDivElement>(null);
119const [prompt, setPrompt] = useState("");
120const [projectId, setProjectId] = useState<number | null>(null);
174}
175176async function handleSubmit(e: React.FormEvent | string) {
177if (typeof e !== "string") {
178e.preventDefault();
673</div>
674<div className="bg-white w-full h-full flex flex-col grow rounded-xl border-2 border-white overflow-hidden">
675<React.Fragment key={iframeKey}>
676<iframe
677srcDoc={code}
679className="w-full grow"
680/>
681</React.Fragment>
682</div>
683</div>