404 Handler
This commit is contained in:
parent
4b1214d96f
commit
7bc98d56b5
1 changed files with 3 additions and 1 deletions
4
main.go
4
main.go
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue