You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/image-url.jpg%20%22Image%20title%22?q=api&page=64&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 19751 results for "api"(4006ms)
50```
51โโโ backend/
52โ โโโ index.ts # Main Hono server with game API endpoints
53โ โโโ database/
54โ โ โโโ migrations.ts # SQLite schema for users, facts, votes, rounds
92- โ **Complete game flow from start to finish**
9394## API Endpoints
9596- `GET /api/game-state` - Get current game state including users, rounds, leaderboard
97- `POST /api/join` - Join the game with a name
98- `POST /api/leave` - Leave the game
99- `POST /api/submit-fact` - Submit a personal fact
100- `POST /api/start-round` - Start a new round with a random fact
101- `POST /api/vote` - Cast a vote for who you think the fact belongs to
102- `POST /api/reveal` - Reveal the answer and award points
103- `POST /api/skip` - Skip the current round
104- `POST /api/admin/kick-all` - **[ADMIN]** Clear all game data and kick all players
105106## Admin Features
48const fetchGameState = async () => {
49try {
50const response = await fetch("/api/game-state");
51if (response.ok) {
52const newGameState = await response.json();
8586try {
87const response = await fetch("/api/join", {
88method: "POST",
89headers: { "Content-Type": "application/json" },
118119try {
120const response = await fetch("/api/submit-fact", {
121method: "POST",
122headers: { "Content-Type": "application/json" },
144145try {
146const response = await fetch("/api/start-round", {
147method: "POST",
148headers: { "Content-Type": "application/json" },
171172try {
173const response = await fetch("/api/vote", {
174method: "POST",
175headers: { "Content-Type": "application/json" },
200201try {
202const response = await fetch("/api/reveal", {
203method: "POST",
204headers: { "Content-Type": "application/json" },
222223try {
224const response = await fetch("/api/skip", {
225method: "POST",
226headers: { "Content-Type": "application/json" },
244245try {
246await fetch("/api/leave", {
247method: "POST",
248headers: { "Content-Type": "application/json" },
272273try {
274const response = await fetch("/api/admin/kick-all", {
275method: "POST",
276headers: { "Content-Type": "application/json" },
316if (currentUserId) {
317navigator.sendBeacon(
318"/api/leave",
319JSON.stringify({ userId: currentUserId })
320);