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.
  1. c.SendFile(path string, gzip ...bool)
  1. app.Get("/not-found", func(c *fiber.Ctx) {
  2. c.SendFile("./public/404.html")
  3.  
  4. // Disable gzipping:
  5. c.SendFile("./static/index.html", true)
  6. })