Repolode
gofiber

gofiber/fiber

Express-inspired web framework for Go, built on the fasthttp engine, for writing REST APIs and web servers.

Stars
40,223
Forks
2,054
Open issues
21
Last commit
17 hours ago

What is it?

Fiber is a web framework for Go that borrows its API style from Express.js, so developers familiar with Node.js can pick up routing, middleware and handler patterns quickly. It runs on top of fasthttp, and the project emphasizes low memory use and zero-allocation request handling, with values from the context reused across requests.

The framework covers routing with path parameters, static file serving, template engines, WebSocket and Server-Sent Events support, and a large set of built-in middleware including CORS, CSRF, rate limiting, compression, caching, session, JWT-style key auth and health checks. It also accepts existing net/http handlers directly and provides an adaptor middleware for bridging whole apps in either direction.

Fiber v3 requires Go 1.26 or higher. Because it uses unsafe, the README notes it may not always keep pace with the latest Go release.

Key features

  • 01Express-style routing with path parameters and wildcards
  • 02Built-in middleware for CORS, CSRF, rate limiting, compression and caching
  • 03WebSocket and Server-Sent Events support
  • 04Template engine integration through the gofiber/template package
  • 05Accepts net/http handlers directly, with an adaptor for bridging apps

Use cases

  • Building REST APIs and JSON backends in Go
  • Porting Express.js-style services to Go
  • Serving static sites or single-page app assets from a Go server
  • Adding real-time features with WebSocket or SSE endpoints

Quick start

  1. 1

    Install Go 1.26 or higher

  2. 2

    Initialize a Go module in your project

    go mod init github.com/your/repo
  3. 3

    Install Fiber

    go get -u github.com/gofiber/fiber/v3
  4. 4

    Save the Hello World example as main.go, run it, and visit localhost:3000

Things to know

  • Requires Go 1.26 or higher, so older Go toolchains cannot be used.
  • Fiber uses unsafe code, so it may not always be compatible with the latest Go versions.
  • Values from fiber.Ctx are reused across requests and must not be kept after the handler returns.

Topics

FAQ

What is fiber?
Express-inspired web framework for Go, built on the fasthttp engine, for writing REST APIs and web servers. Fiber is a web framework for Go that borrows its API style from Express.js, so developers familiar with Node.js can pick up routing, middleware and handler patterns quickly. It runs on top of fasthttp, and the project emphasizes low memory use and zero-allocation request handling, with values from the context reused across requests.
Is fiber free to use? What license does it have?
fiber is open source under the MIT license. Check the license terms before using it in commercial products.
Is fiber still maintained?
Actively maintained. The last commit to fiber was on Oct 19, 2026.
What can I use fiber for?
Building REST APIs and JSON backends in Go Porting Express.js-style services to Go Serving static sites or single-page app assets from a Go server Adding real-time features with WebSocket or SSE endpoints
How do I install fiber?
Install Go 1.26 or higher Initialize a Go module in your project: go mod init github.com/your/repo Install Fiber: go get -u github.com/gofiber/fiber/v3 Save the Hello World example as main.go, run it, and visit localhost:3000
Where can I get fiber?
The source code and installation instructions are on GitHub: https://github.com/gofiber/fiber

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects