[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 38 lines 868 B view raw
1import { Hono } from "hono"; 2import { formatMultikey, Secp256k1Keypair } from "@atp/crypto"; 3import { AppEnv } from "../context.ts"; 4 5const app = new Hono<AppEnv>(); 6 7app.get("/did.json", (c) => { 8 const did = c.env.cfg.serverDid; 9 const keypair = Secp256k1Keypair.import( 10 c.env.cfg.privateKey, 11 ); 12 const multikey = formatMultikey(keypair.jwtAlg, keypair.publicKeyBytes()); 13 14 return c.json({ 15 "@context": [ 16 "https://www.w3.org/ns/did/v1", 17 "https://w3id.org/security/multikey/v1", 18 ], 19 id: did, 20 verificationMethod: [ 21 { 22 id: `${did}#atproto`, 23 type: "Multikey", 24 controller: did, 25 publicKeyMultibase: multikey, 26 }, 27 ], 28 service: [ 29 { 30 id: "#sprk_appview", 31 type: "SprkAppView", 32 serviceEndpoint: c.env.cfg.publicUrl, 33 }, 34 ], 35 }); 36}); 37 38export default app;