this repo has no description
at master 796 B view raw
1package main 2 3import ( 4 "net/http" 5 6 "github.com/labstack/echo/v4" 7) 8 9const NgrokHostname = "routinely-right-barnacle.ngrok-free.app" 10 11type DidDocument struct { 12 Context []string `json:"@context"` 13 ID string `json:"id"` 14 Services []DidService `json:"service"` 15} 16 17type DidService struct { 18 ID string `json:"id"` 19 ServiceType string `json:"type"` 20 ServiceEndpoint string `json:"serviceEndpoint"` 21} 22 23func didDoc(c echo.Context) error { 24 doc := DidDocument{ 25 Context: []string{"https://www.w3.org/ns/did/v1"}, 26 ID: `did:web:` + NgrokHostname, 27 Services: []DidService{ 28 DidService{ 29 ID: "#bsky_fg", 30 ServiceType: "BskyFeedGenerator", 31 ServiceEndpoint: `https://` + NgrokHostname, 32 }, 33 }, 34 } 35 return c.JSON(http.StatusOK, doc) 36}