qmetrics.net

chi

Lightweight composable HTTP router for Go services

chi screenshot

chi is a small Go router for building REST APIs and HTTP services. It stays compatible with net/http and stdlib middleware.

Overview

chi is a Go package that routes HTTP requests using a lightweight radix trie design. It targets teams that want maintainable REST APIs without leaving the standard library handler model.

Routing accepts URL patterns with named parameters and wildcards, mounts sub-routers, and groups routes with inline or shared middleware. Handlers remain ordinary net/http types, so third-party middleware from the wider Go ecosystem can plug in directly.

The router builds on Go’s context package for per-request values, cancellation, and timeouts. Optional companion packages add common middleware such as logging, compression, throttling, request IDs, recovery, and several safe client IP extractors, plus helpers for rendering and route documentation generation.

The core router is compact and ships without external dependencies beyond the stdlib. Documentation can be generated from source into JSON or Markdown to describe mounted routes.

Key features

  • net/http compatible handler model
  • Named params and wildcard routes
  • Route groups and sub-router mounts
  • Optional chi/middleware suite
  • Context values and timeouts
  • Doc generation for routes
  • Modular render helpers
  • No third-party dependencies

Use cases

  • Building Go REST API servers
  • Composing HTTP middleware chains
  • Mounting versioned API sub-routers
  • Publishing auto-generated route docs
  • Microservice HTTP entrypoints

Tags

Similar software

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

OkHttp

HTTP client for JVM, Android, and GraalVM

OkHttp is an HTTP client library tuned for efficient networking on Android, Java, and GraalVM native images. It offers synchronous and asynchronous call APIs with a fluent request builder.

★ 47.1k⟳ yesterdayApache-2.0
Frameworks & PlatformsDesktop/CLI app

gRPC

Cross-language remote procedure call framework

gRPC is an RPC framework that lets client and server programs communicate transparently and supports building connected, multi-language systems.

★ 45.5k⟳ todayApache-2.0

tRPC

End-to-end typesafe TypeScript APIs without code generation

tRPC helps teams define server procedures and call them from clients with full TypeScript types for inputs, outputs, and errors—no schemas or codegen step.

★ 40.9k⟳ todayMIT
Frameworks & PlatformsDesktop/CLI app

go-zero

Cloud-native Go microservices and RPC framework

go-zero is a Go web and RPC framework with code generation, built-in resilience middleware, and tooling aimed at stable high-traffic services.

★ 33.5k⟳ 9 days agoMIT