RoadSign/pkg/sideload/reload.go
2024-09-29 23:03:11 +08:00

19 lines
439 B
Go

package sideload
import (
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
"github.com/gofiber/fiber/v2"
"github.com/spf13/viper"
)
func doReload(c *fiber.Ctx) error {
if err := navi.ReadInConfig(viper.GetString("paths.configs")); err != nil {
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
}
if c.QueryBool("warden", false) {
navi.InitializeWarden(navi.R.Regions)
}
return c.SendStatus(fiber.StatusOK)
}