From 9ae6153d4750fb9243a2d8de5420daecb4682b74 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Sun, 24 Oct 2021 11:44:05 +0200 Subject: [PATCH] Nicer LNURLp URLs this also registers a shorter lnurlp that can be used additionally to the lightning address --- lnme.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lnme.go b/lnme.go index 5056753..31f6584 100644 --- a/lnme.go +++ b/lnme.go @@ -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