add route to get if the resourced is enabled

This commit is contained in:
blek 2023-11-05 15:33:30 +10:00 committed by blek! Git
parent 8a6c411bf8
commit 15d47c8fea
1 changed files with 4 additions and 0 deletions

View File

@ -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")