1
1
mirror of https://github.com/bumi/lntip synced 2025-06-16 17:55:35 +00:00

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

View File

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