From 45c47d9b0cbe7361e7e71d5c18d57d865e1ecf6b Mon Sep 17 00:00:00 2001 From: blek Date: Sun, 5 Nov 2023 15:33:30 +1000 Subject: [PATCH] add route to get if the resourced is enabled --- resource/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resource/main.go b/resource/main.go index 2822d34..c17a903 100644 --- a/resource/main.go +++ b/resource/main.go @@ -95,6 +95,10 @@ func main() { AppName: "blek! File resourceD", }) + app.Get("/info/is_enabled", func (c *fiber.Ctx) error { + return c.JSON(conf.ResourceD.Enabled) + }) + app.Use(func (c *fiber.Ctx) error { if ! conf.ResourceD.Enabled { return c.Status(fiber.StatusNotFound).SendString("ResourceD is disabled")