You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Bsuccess?q=image&page=9&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=image
Returns an array of strings in format "username" or "username/projectName"
Found 6332 results for "image"(1484ms)
9let response;
10try {
11response = await blob.get("pondiverse_image" + id);
12} catch (e) {
13return new Response(null, { status: 404 });
9// - data (string)
10// - type (string)
11// - image (data url string)
12// sanity checks:
13// - title, not toooo long
14// - data, hmm this needs to be long i guess.. maybe some crazy upper limit sanity check though
15// - type, not too long
16// - image, not toooo large a file size
17let body;
18try {
25const data = body.data;
26const type = body.type;
27const image = body.image;
2829// Sanity checks
37}
3839if (image && image.length > 20 * 1024 * 1024) {
40return Response.json({ ok: false, error: "Thumbnail too large" });
41}
57);
5859// only creates blob if there is indeed an image and updates the image column to represent that
60if (image) {
61const imageName = "pondiverse_image" + id.lastInsertRowid;
62const imageAddr = `${Deno.env.get("PONDIVERSE_STORE_BASE_PATH")}/get-creation-image?id=${id.lastInsertRowid}`;
63await blob.set(imageName, image);
64await sqlite.execute(
65`UPDATE ${TABLE_NAME} SET image = "${imageAddr}" WHERE id = ${id.lastInsertRowid}`,
66);
67}
6869return Response.json({ ok: true, image: image });
70}