add ruleset route

This commit is contained in:
Gianni Carafa
2023-11-05 23:30:32 +01:00
parent 07513f6dc4
commit 34a2683457
3 changed files with 22 additions and 2 deletions

17
handlers/ruleset.go Normal file
View File

@@ -0,0 +1,17 @@
package handlers
import (
"github.com/gofiber/fiber/v2"
"gopkg.in/yaml.v3"
)
func Ruleset(c *fiber.Ctx) error {
body, err := yaml.Marshal(rulesSet)
if err != nil {
c.SendStatus(fiber.StatusInternalServerError)
return c.SendString(err.Error())
}
return c.SendString(string(body))
}