Check client ip

This commit is contained in:
LittleSheep 2024-09-21 20:03:37 +08:00
parent 00c52eba68
commit a6212335e7
2 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,7 @@
package api
import "github.com/gofiber/fiber/v2"
func getClientIP(c *fiber.Ctx) error {
return c.SendString(c.IP())
}

View File

@ -12,6 +12,7 @@ func MapAPIs(app *fiber.App) {
wellKnown.Get("/", func(c *fiber.Ctx) error { wellKnown.Get("/", func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK) return c.SendStatus(fiber.StatusOK)
}) })
wellKnown.Get("/check-ip", getClientIP)
wellKnown.Get("/directory/services", listExistsService) wellKnown.Get("/directory/services", listExistsService)
} }