SendFile
Transfers the file from the given path. Sets the Content-Type response HTTP header field based on the filenames extension.
Method use gzipping by default, set it to true to disable.
- c.SendFile(path string, gzip ...bool)
- app.Get("/not-found", func(c *fiber.Ctx) {
- c.SendFile("./public/404.html")
- // Disable gzipping:
- c.SendFile("./static/index.html", true)
- })