1
1
mirror of https://github.com/bumi/lntip synced 2026-02-16 22:17:50 +00:00

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

Nicer LNURLp URLs
This commit is contained in:
2021-10-25 10:59:43 +02:00
committed by GitHub

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