404 Handler

This commit is contained in:
Phil 2021-12-07 17:40:28 +01:00
parent 4b1214d96f
commit 7bc98d56b5

View file

@ -43,7 +43,9 @@ func main() {
app.Get("/:id", func(c *fiber.Ctx) error {
val, err := client.Get(c.Params("id")).Result()
if err != nil {
return c.SendString(err.Error())
return c.Render("home", fiber.Map{
"ERR": "404 URL not found",
})
}
return c.Redirect(val)
})