1
1
mirror of https://github.com/bumi/lntip synced 2026-05-12 10:40:26 +00:00

Formatting

This commit is contained in:
2021-08-27 11:18:49 +02:00
parent 5c8d604a20
commit 518a834066
2 changed files with 67 additions and 66 deletions

25
lnme.go
View File

@@ -2,7 +2,12 @@ package main
import (
"flag"
"github.com/GeertJohan/go.rice"
"log"
"net/http"
"os"
"strings"
rice "github.com/GeertJohan/go.rice"
"github.com/bumi/lnme/ln"
"github.com/didip/tollbooth/v6"
"github.com/didip/tollbooth/v6/limiter"
@@ -13,10 +18,6 @@ import (
"github.com/knadh/koanf/providers/file"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"log"
"net/http"
"os"
"strings"
)
// Middleware for request limited to prevent too many requests
@@ -124,9 +125,9 @@ func main() {
})
// Check invoice status
e.GET("/v1/invoice/:invoiceId", func(c echo.Context) error {
invoiceId := c.Param("invoiceId")
invoice, err := lnClient.GetInvoice(invoiceId)
e.GET("/v1/invoice/:paymentHash", func(c echo.Context) error {
paymentHash := c.Param("paymentHash")
invoice, err := lnClient.GetInvoice(paymentHash)
if err != nil {
stdOutLogger.Printf("Error looking up invoice: %s", err)
@@ -141,10 +142,10 @@ func main() {
return c.JSON(http.StatusOK, "pong")
})
port := cfg.String("port")
if os.Getenv("PORT") != "" {
port = os.Getenv("PORT")
}
port := cfg.String("port")
if os.Getenv("PORT") != "" {
port = os.Getenv("PORT")
}
e.Logger.Fatal(e.Start(":" + port))
}