✨ Status checker endpoint
This commit is contained in:
parent
fbfb340058
commit
82305206b0
@ -33,7 +33,11 @@ func forwardServiceRequest(c *fiber.Ctx) error {
|
||||
|
||||
ogUrl := c.Request().URI().String()
|
||||
url := c.OriginalURL()
|
||||
prevUrl := url
|
||||
url = strings.Replace(url, "/srv/"+serviceType, "/api", 1)
|
||||
if prevUrl == url {
|
||||
url = strings.Replace(url, "/cgi/"+serviceType, "/api", 1)
|
||||
}
|
||||
url = "http://" + *service.HttpAddr + url
|
||||
|
||||
log.Debug().
|
||||
|
@ -9,9 +9,13 @@ import (
|
||||
func MapAPIs(app *fiber.App) {
|
||||
wellKnown := app.Group("/.well-known").Name("Well Known")
|
||||
{
|
||||
wellKnown.Get("/", func(c *fiber.Ctx) error {
|
||||
return c.SendStatus(fiber.StatusOK)
|
||||
})
|
||||
wellKnown.Get("/directory/services", listExistsService)
|
||||
}
|
||||
|
||||
app.All("/cgi/:service/*", forwardServiceRequest)
|
||||
app.All("/srv/:service/*", forwardServiceRequest)
|
||||
|
||||
api := app.Group("/api").Name("API")
|
||||
|
Loading…
Reference in New Issue
Block a user