github gofiber/fiber v1.8.4

latest releases: v3.0.0-beta.2, v2.52.4, v2.52.3...
4 years ago

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)
}

Don't miss a new fiber release

NewReleases is sending notifications on new releases.