tangled
alpha
login
or
join now
yoyle.city
/
skittr
6
fork
atom
this repo has no description
atproto
bluesky
typescript
express
6
fork
atom
overview
issues
3
pulls
pipelines
you can now resolve handles through did documents
lime360
1 month ago
1984930c
f743110a
1/1
test.yml
success
24s
+10
-5
2 changed files
expand all
collapse all
unified
split
src
lib
resolver.ts
routes
appview.ts
+7
-2
src/lib/resolver.ts
reviewed
···
51
51
}
52
52
}
53
53
54
54
-
export async function byPLC(did: string, endpoint: string = "https://plc.directory"): Promise<any> {
54
54
+
export async function getPLC(did: string, endpoint: string = "https://plc.directory"): Promise<any> {
55
55
const agent = new Agent({ keepAliveTimeout: 10000 });
56
56
setGlobalDispatcher(agent);
57
57
···
69
69
}
70
70
}
71
71
72
72
+
export async function byPLC(did: string) {
73
73
+
const didDoc = await getPLC(did);
74
74
+
return didDoc.id;
75
75
+
}
76
76
+
72
77
export async function getPDS(did: string) {
73
73
-
const didDoc = await byPLC(did);
78
78
+
const didDoc = await getPLC(did);
74
79
return didDoc.service[0].serviceEndpoint;
75
80
}
+3
-3
src/routes/appview.ts
reviewed
···
1
1
import { Router, Request, Response } from "express";
2
2
-
import { byDNS, byHTTP, byPLC } from "../lib/resolver.js";
2
2
+
import { getPLC, byPLC } from "../lib/resolver.js";
3
3
4
4
const api = Router();
5
5
···
22
22
});
23
23
}
24
24
25
25
-
const did = await byDNS(handle);
25
25
+
const did = await byPLC(handle);
26
26
27
27
if (!did) {
28
28
return res.status(400).json({
···
47
47
});
48
48
}
49
49
50
50
-
const didDoc = await byPLC(did);
50
50
+
const didDoc = await getPLC(did);
51
51
52
52
if (!didDoc) {
53
53
return res.status(400).json({