diff --git a/cmd/main.go b/cmd/main.go index 851c35a..ef6d404 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -48,11 +48,7 @@ func main() { }) } - if os.Getenv("DISABLE_FORM") != "true" { - app.Get("/", handlers.Form) - } else { - app.Get("/", handlers.NoForm) - } + app.Get("/", handlers.Form) app.Get("raw/*", handlers.Raw) app.Get("api/*", handlers.Api) diff --git a/handlers/form.go b/handlers/form.go index 70df457..cab5138 100644 --- a/handlers/form.go +++ b/handlers/form.go @@ -1,16 +1,20 @@ package handlers -import "github.com/gofiber/fiber/v2" +import ( + "os" -func NoForm(c *fiber.Ctx) error { - c.Set("Content-Type", "text/html") - c.SendStatus(fiber.StatusNotFound) - return c.SendString("Form Disabled") -} + "github.com/gofiber/fiber/v2" +) func Form(c *fiber.Ctx) error { - c.Set("Content-Type", "text/html") - return c.SendString(html) + if os.Getenv("DISABLE_FORM") == "true" { + c.Set("Content-Type", "text/html") + c.SendStatus(fiber.StatusNotFound) + return c.SendString("Form Disabled") + } else { + c.Set("Content-Type", "text/html") + return c.SendString(html) + } } const html = `