2024-01-31 05:46:12 +00:00
|
|
|
package sideload
|
|
|
|
|
|
|
|
import (
|
2024-09-29 15:03:11 +00:00
|
|
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
2024-01-31 05:46:12 +00:00
|
|
|
"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)
|
|
|
|
}
|