Skip to content
Pro

Echo

Build fast Go APIs.
Without the bloat.

A high-performance, minimalist Go web framework with a zero-allocation router, batteries-included middleware and an expressive API.

go get github.com/labstack/echo/v5

Building a multi-tenant API? Echo Pro adds API keys, tenant isolation, quotas and signed webhooks.

server.go · excerpt
e := echo.New()
// Middleware
e.Use(middleware.RequestLogger())
e.Use(middleware.Recover())
// Route => handler
e.GET("/", func(c *echo.Context) error {
return c.String(http.StatusOK, "Hello, World!\n")
})

Built on Echo

See all adopters
32.8kGitHub stars
0 allocsrouter, per request
25+built-in middlewares
MITopen source license

Features

Optimized router

Radix-tree router; matching a route allocates no memory with default settings. Static paths match before parameters, parameters before wildcards.

Middleware

CORS, CSRF, rate limiting, gzip, recover and request logging ship in Echo’s middleware package. JWT, sessions and metrics are official add-ons.

Data binding

Bind JSON, XML or form bodies and path parameters into a struct with one call to c.Bind. The binding guide covers query parameters.

TLS and HTTP/2

StartConfig.StartTLS serves HTTPS from certificate files, or set StartConfig.TLSConfig and call Start. HTTP/2 works over TLS by default.

Extensible

Write middleware as a plain function. Replace the binder, validator, renderer, IP extractor or error handler.

Templates

Use echo.TemplateRenderer for html/template, or set e.Renderer to any engine that implements echo.Renderer.

Quickstart

  1. Install

    Create a module and add Echo.

    go mod init myapp
    go get github.com/labstack/echo/v5
  2. Write

    Create server.go with one route. The full example adds imports and main.

    e.GET("/", func(c *echo.Context) error {
    return c.String(http.StatusOK, "Hello, World!\n")
    })
  3. Run

    Fetch dependencies and start serving on port 1323.

    go mod tidy
    go run server.go

Official packages

Sponsors

Echo stays MIT. Echo Pro is a separate commercial library that funds it.

Production building blocks for teams running multi-tenant APIs on Echo v5.

Site links

echo

High performance, extensible, minimalist Go web framework.