httprouter VS chi

Compare httprouter vs chi and see what are their differences.

httprouter

A high performance HTTP request router that scales well (by julienschmidt)

chi

lightweight, idiomatic and composable router for building Go HTTP services (by go-chi)
Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
httprouter chi
13 34
13,583 10,750
- 2.4%
0.0 7.2
2 months ago 13 days ago
Go Go
BSD 3-clause "New" or "Revised" License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

httprouter

Posts with mentions or reviews of httprouter. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-01-02.

chi

Posts with mentions or reviews of chi. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-01-04.
  • chai - a library for type safe http handlers via generics with automatic swagger generation
    7 projects | reddit.com/r/golang | 4 Jan 2022
    chai is an extension for a few popular http routers (chi, gorilla/mux) that adds support for type safe http handlers via Go 1.18's generics. This allows it to also generate a swagger spec by automatically detecting the request/response types, http methods, route paths and path params.
  • What framework do you use at work for web dev?
    7 projects | reddit.com/r/golang | 30 Dec 2021
    This.
  • I share my authentication server.
    18 projects | reddit.com/r/golang | 20 Dec 2021
    HTTP Server, Middleware - chi, HTTP, oapi-codegen
  • Which web framework would you recommend?
    4 projects | reddit.com/r/golang | 3 Dec 2021
    I'm a big fan of go-chi. Their documentation and examples are top-notch.
  • 4 Things to Consider When Choosing a Go API Framework
    5 projects | dev.to | 16 Nov 2021
    Eli Bendersky has an excellent series where they walk you through building a REST API in Go by first starting with the standard library and then introducing a router such as gorilla or chi and finally switching over to using a complete web framework. This series shows some of the downsides of sticking with the standard library entirely and how extra libraries such as the two router packages above can be extremely helpful.
  • Would it be better to use Frameworks or not ?
    3 projects | reddit.com/r/golang | 25 Oct 2021
    If you purely build a rest api using core modules will get you pretty far. There are multiple small wrappers out there that provide better routing and possibly a nicer api. As an example https://github.com/go-chi/chi is only 1K LOC and compatible with handleFunc.
  • Release v2.20.0 · gofiber/fiber
    2 projects | reddit.com/r/golang | 6 Oct 2021
    I really like chi. Feels like an extension for the go http lib
  • Migrating from PHP to Go
    26 projects | reddit.com/r/golang | 30 Sep 2021
    https://github.com/go-chi/chi for routing, it has a nice interface, and is extremely light on resources (not a big deal for a router, but if it's available with a nice API, why not?
    26 projects | reddit.com/r/golang | 30 Sep 2021
    I'm a big fan of [Twirp RPC](https://github.com/twitchtv/twirp), and [go-chi/chi](https://github.com/go-chi/chi) if I need to provide REST endpoints, authentication or other routing middleware. The "gorilla" set of packages are also useful, I always reach for gorilla/websocket if I need to do some websocket work. You can look at an example service in [go-bridget/notify](https://github.com/go-bridget/notify) - the main files to look at are under rpc/notify/notify.proto/.go, and the implementation which you write is under server/notify. If you'd create database drivers, I'd create a package under server/notify/mysql (for example), and then implement an interface for data retrieval/settings. It's on the todolist, if I'll ever need to implement anything other than JWT, or Redis. Comment if you have any questions or notes.
  • Router/mux for golang.
    1 project | reddit.com/r/golang | 5 Sep 2021
    I’m personally a fan of chi router. Fast, works with standard http package handlers.

What are some alternatives?

When comparing httprouter and chi you can also consider the following projects:

Gin - Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

mux - A powerful HTTP router and URL matcher for building Go web servers with 🦍

Echo - High performance, minimalist Go web framework

Fiber - ⚡️ Express inspired web framework written in Go

fasthttp - Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http

go-kit - A standard library for microservices.

negroni - Idiomatic HTTP Middleware for Golang

Iris - The fastest HTTP/2 Go Web Framework. AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. A true successor of expressjs and laravel | 谢谢 https://github.com/kataras/iris/issues/1329 |

Goji - Goji is a minimalistic and flexible HTTP request multiplexer for Go (golang)