Merge pull request #23 from bumi/feature/nicer-lnurlp-urls

Nicer LNURLp URLs
This commit is contained in:
bumi 2021-10-25 10:59:43 +02:00 committed by GitHub
commit 0fd121d130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -144,7 +144,7 @@ func main() {
})
if !cfg.Bool("disable-ln-address") {
e.GET("/.well-known/lnurlp/:name", func(c echo.Context) error {
lnurlHandler := func(c echo.Context) error {
name := c.Param("name")
lightningAddress := name + "@" + c.Request().Host
lnurlMetadata := "[[\"text/identifier\", \"" + lightningAddress + "\"], [\"text/plain\", \"Sats for " + lightningAddress + "\"]]"
@ -183,7 +183,9 @@ func main() {
}
return c.JSON(http.StatusOK, lnurlPayResponse2)
}
})
}
e.GET("/.well-known/lnurlp/:name", lnurlHandler)
e.GET("/lnurlp/:name", lnurlHandler)
}
// Debug test endpoint