Added request logging

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2021-12-05 13:33:22 +00:00
parent aab4a6678d
commit fe5425ca50
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78

View File

@ -6,6 +6,7 @@ import (
"strings" "strings"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
"maunium.net/go/mautrix" "maunium.net/go/mautrix"
"maunium.net/go/mautrix/id" "maunium.net/go/mautrix/id"
) )
@ -51,6 +52,7 @@ func init() {
func main() { func main() {
app := fiber.New() app := fiber.New()
app.Use(logger.New())
app.Post("/", HandlePayloadPost) app.Post("/", HandlePayloadPost)
app.Post("/alertmanager", HandleAlertmanagerPayloadPost) app.Post("/alertmanager", HandleAlertmanagerPayloadPost)
app.Listen(fmt.Sprintf(":%s", port)) app.Listen(fmt.Sprintf(":%s", port))