Skip to content

v1.8.4

Compare
Choose a tag to compare
@Fenny Fenny released this 23 Mar 03:03
1ff2727

Some old deprecated functions are now removed and template engines are moved to a separate middleware .

🔥 New

app.Static("/", "./static", fiber.Static{
  Compress:   true, // Optional, default: false
  ByteRange:  true, // Optional, default: false
  Browse:     true, // Optional, default: false
  Index:      "john.html" // Optional, default: "index.html",
})

🧹 Updates

🩹 Fixes

  • Serve index.html on root paths using Static #222 (comment)
  • 1.11.x, 1.12.x, 1.13.x, 1.14.x Go version are now also tested
  • Internal optimizations / clean-up
  • Removed unused dependencies
  • Static case sensitive mis matches #227
  • Static Update file/folder changes #221
  • Static Fix iconfont files #222 (comment)
  • Add partial comments to all functions for faster development
  • Remove unused *Conn from *Ctx struct

🗑️ Removed

🧬 Middleware

index.mustache

<html>
<head>
  <title>Template Demo</title>
</head>
<body>
  Hi, my name is {{{name}}} and im {{{age}}} years old
</body>
</html>

server.go

package main

import (
  "github.com/gofiber/fiber"
  "github.com/gofiber/template"
)

func main() {
  app := fiber.New()

  app.Settings.TemplateEngine = template.Mustache()

  app.Get("/", func(c *fiber.Ctx) {
    bind := fiber.Map{
      "name": "John",
      "age":  "35",
    }
    if err := c.Render("./index.mustache", bind); err != nil {
      panic(err)
    }
  })

  app.Listen(3000)
}