+6
-2
landing/landing.ts
+6
-2
landing/landing.ts
···
1
1
import css from "./css.css" with { type: "text" };
2
2
import heading from "./heading.txt" with { type: "text" };
3
3
4
-
Deno.serve({ port: 8000 }, (req) => {
4
+
Deno.serve({ port: 8910 }, (req) => {
5
5
switch (new URL(req.url).pathname) {
6
6
case "/css":
7
7
return new Response(css, {
···
26
26
// type cast because no point validating for smthn like this
27
27
// real type has more info; not needed here
28
28
.then((res) => res.json() as Promise<{ repos: { did: string }[] }>)
29
+
.then((res) => {
30
+
console.log(res);
31
+
return res;
32
+
})
29
33
.then((res) =>
30
34
// get display name, handle, and did for each user
31
35
res.repos.map((repo) => ({
···
33
37
`http://pi:8000/xrpc/com.atproto.repo.getRecord?repo=${repo.did}&collection=app.bsky.actor.profile&rkey=self`
34
38
)
35
39
.then((res) => res.json())
36
-
.then((profile) => profile?.value?.displayName),
40
+
.then((profile) => profile?.value?.displayName ?? repo),
37
41
// dont validate handles because I'm Lazy + trust myself
38
42
handle: fetch(
39
43
repo.did.startsWith("did:plc")