simplify rewriters api usage

This commit is contained in:
Kevin Pham
2023-11-26 22:51:00 -06:00
parent ae48429da7
commit 98d6b65057
9 changed files with 38 additions and 117 deletions

View File

@@ -1,21 +1,9 @@
package handlers
import (
"log"
"github.com/gofiber/fiber/v2"
)
func Raw(c *fiber.Ctx) error {
// Get the url from the URL
urlQuery := c.Params("*")
queries := c.Queries()
body, _, _, err := fetchSite(urlQuery, queries)
if err != nil {
log.Println("ERROR:", err)
c.SendStatus(500)
return c.SendString(err.Error())
}
return c.SendString(body)
return nil
}