OverviewFilesCommitsIssuesDocsReleasesPeers

apds commits / dc8ab11

return apds queries for pubkeys and an "all" route
dc8ab1132d6ced6105cefb0e5315942a3c31049d
by Everett Bogue <ev@evbogue.com> · 2025-10-22T14:01:12.000Z

Changed files (1) +2 -10

serve.js +2 -10
……@@ -72,24 +72,16 @@ const directory = async (r) => {
7272 const header = new Headers()
7373 header.append("Content-Type", "application/json")
7474 header.append("Access-Control-Allow-Origin", "*")
75 const q = await apds.query(key)
7576 if (db[key]) {
7677 const ar = db[key]
7778 return new Response(JSON.stringify(ar), {headers: header})
7879 }
79 if (await apds.getLatest(key)) {
80 const latest = await apds.getLatest(key)
81 if (!latest.text) {
82 const text = await apds.get(latest.opened.substring(13))
83 latest.text = text.value
84 }
85 return new Response(JSON.stringify(latest), {headers: header})
86 }
8780 if (key === 'all') {
8881 const q = await apds.query()
8982 return new Response(JSON.stringify(q), {headers: header})
9083 }
91 else if (key != '' && await apds.query(key)) {
92 const q = await apds.query(key)
84 if (q[0]) {
9385 return new Response(JSON.stringify(q), {headers: header})
9486 } else {
9587 return serveDir(r, {