well-goknown/main.go

30 lines
702 B
Go
Raw Normal View History

package main
import (
"net/http"
"git.minhas.io/asara/well-goknown/matrix"
"git.minhas.io/asara/well-goknown/nostr"
)
func main() {
2023-02-03 04:56:15 +00:00
/*
nostrTest := nostr.NostrRequest{
Name: "asara",
2023-02-04 22:46:13 +00:00
Key: "npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6",
2023-02-03 04:56:15 +00:00
Hostname: "devvul.com",
}
2023-02-04 23:52:50 +00:00
nostr.AddNostrAddr(nostrTest)
2023-02-03 04:56:15 +00:00
*/
// matrix endpoints
2023-02-04 01:15:41 +00:00
http.HandleFunc("/.well-known/matrix/server", matrix.MatrixServer)
http.HandleFunc("/.well-known/matrix/client", matrix.MatrixClient)
2023-02-03 04:56:15 +00:00
// nostr endpoints
http.HandleFunc("/.well-known/nostr.json", nostr.GetNostrAddr)
2023-02-03 04:56:15 +00:00
http.HandleFunc("/request/nostr", nostr.RequestNostrAddr)
// start server
http.ListenAndServe(":8090", nil)
}