Convert Figma logo to code with AI

go-chi logochi

lightweight, idiomatic and composable router for building Go HTTP services

18,066
973
18,066
92

Top Related Projects

20,665

Package gorilla/mux is a powerful HTTP router and URL matcher for building Go web servers with 🦍

77,851

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.

29,410

High performance, minimalist Go web framework

A high performance HTTP request router that scales well

33,019

⚡️ Express inspired web framework written in Go

21,607

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

Quick Overview

Chi is a lightweight, idiomatic, and composable router for building Go HTTP services. It's built on top of the standard net/http package and is designed to be fast, flexible, and easy to use. Chi encourages clean, modular, and maintainable code by providing a simple yet powerful routing system.

Pros

  • Lightweight and has zero external dependencies
  • Highly performant and optimized for real-world workloads
  • Supports middleware chaining and composable routing
  • Compatible with net/http standard library

Cons

  • Less feature-rich compared to some full-fledged web frameworks
  • May require additional libraries for more complex web applications
  • Learning curve for developers new to Go's HTTP patterns

Code Examples

  1. Basic router setup:
package main

import (
    "net/http"
    "github.com/go-chi/chi/v5"
)

func main() {
    r := chi.NewRouter()
    r.Get("/", func(w http.ResponseWriter, r *http.Request) {
        w.Write([]byte("Welcome"))
    })
    http.ListenAndServe(":3000", r)
}
  1. Using URL parameters:
r.Get("/users/{id}", func(w http.ResponseWriter, r *http.Request) {
    userID := chi.URLParam(r, "id")
    w.Write([]byte("User ID: " + userID))
})
  1. Middleware example:
func Logger(next http.Handler) http.Handler {
    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
        fmt.Println("Logged request:", r.URL.Path)
        next.ServeHTTP(w, r)
    })
}

r.Use(Logger)

Getting Started

To start using Chi, first install it:

go get -u github.com/go-chi/chi/v5

Then, create a basic server:

package main

import (
    "net/http"
    "github.com/go-chi/chi/v5"
    "github.com/go-chi/chi/v5/middleware"
)

func main() {
    r := chi.NewRouter()
    r.Use(middleware.Logger)
    r.Get("/", func(w http.ResponseWriter, r *http.Request) {
        w.Write([]byte("Hello, World!"))
    })
    http.ListenAndServe(":3000", r)
}

This sets up a simple Chi router with logging middleware and a single route that responds with "Hello, World!" when accessed at the root URL.

Competitor Comparisons

20,665

Package gorilla/mux is a powerful HTTP router and URL matcher for building Go web servers with 🦍

Pros of mux

  • More mature and widely adopted in the Go community
  • Extensive documentation and examples available
  • Built-in support for URL path variables and subrouters

Cons of mux

  • Slightly more verbose routing syntax
  • Performance may be slightly lower in high-load scenarios
  • Less actively maintained compared to chi

Code Comparison

mux:

r := mux.NewRouter()
r.HandleFunc("/users/{id}", GetUser).Methods("GET")
r.HandleFunc("/users", CreateUser).Methods("POST")

chi:

r := chi.NewRouter()
r.Get("/users/{id}", GetUser)
r.Post("/users", CreateUser)

Key Differences

  • chi offers a more concise routing syntax
  • mux provides built-in support for HTTP methods in route definitions
  • chi focuses on simplicity and performance
  • mux offers more features out of the box

Both mux and chi are popular routing libraries for Go, with mux being more established and feature-rich, while chi emphasizes simplicity and performance. The choice between them often depends on specific project requirements and personal preferences.

77,851

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.

Pros of Gin

  • Higher performance due to custom routing algorithm
  • Built-in middleware and features like logging, recovery, and JSON validation
  • Extensive documentation and large community support

Cons of Gin

  • More opinionated and less flexible than Chi
  • Steeper learning curve for beginners
  • Heavier dependency footprint

Code Comparison

Chi:

r := chi.NewRouter()
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("welcome"))
})

Gin:

r := gin.Default()
r.GET("/", func(c *gin.Context) {
    c.String(http.StatusOK, "welcome")
})

Summary

Chi and Gin are both popular Go web frameworks, but they have different philosophies. Chi focuses on simplicity and flexibility, adhering closely to the standard library's http.Handler interface. Gin, on the other hand, offers more built-in features and higher performance at the cost of a steeper learning curve and less flexibility.

Chi is ideal for developers who prefer a minimalist approach and want to maintain full control over their application's structure. Gin is better suited for projects that require high performance and can benefit from its extensive built-in features.

The choice between Chi and Gin ultimately depends on the specific requirements of your project and your personal preferences as a developer.

29,410

High performance, minimalist Go web framework

Pros of Echo

  • Built-in middleware for common tasks like CORS, JWT, and rate limiting
  • Automatic API documentation generation with Swagger
  • Extensive and well-organized documentation

Cons of Echo

  • Larger codebase and more dependencies
  • Steeper learning curve for beginners
  • Less flexibility for custom routing patterns

Code Comparison

Echo:

e := echo.New()
e.GET("/", func(c echo.Context) error {
    return c.String(http.StatusOK, "Hello, World!")
})
e.Logger.Fatal(e.Start(":1323"))

Chi:

r := chi.NewRouter()
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("Hello, World!"))
})
http.ListenAndServe(":3000", r)

Both Echo and Chi are popular Go web frameworks, but they have different design philosophies. Echo focuses on providing a full-featured, batteries-included approach with built-in middleware and tools. Chi, on the other hand, emphasizes simplicity and follows Go's standard library patterns more closely.

Echo's extensive feature set and middleware ecosystem make it attractive for larger projects or those requiring quick development of complex APIs. However, this comes at the cost of a larger codebase and potentially more overhead.

Chi's minimalist approach allows for greater flexibility and easier integration with existing Go code. It's often preferred for smaller projects or by developers who want more control over their application's structure. The trade-off is that developers may need to implement or integrate additional functionality themselves.

A high performance HTTP request router that scales well

Pros of httprouter

  • Extremely fast and lightweight, optimized for high performance
  • Simple API with minimal learning curve
  • Supports named parameters and catch-all routes

Cons of httprouter

  • Limited middleware support
  • Less flexible routing patterns compared to chi
  • Fewer built-in features for complex applications

Code Comparison

httprouter:

router := httprouter.New()
router.GET("/user/:name", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
    fmt.Fprintf(w, "hello, %s!\n", ps.ByName("name"))
})

chi:

r := chi.NewRouter()
r.Get("/user/{name}", func(w http.ResponseWriter, r *http.Request) {
    name := chi.URLParam(r, "name")
    fmt.Fprintf(w, "hello, %s!\n", name)
})

Key Differences

  • httprouter uses a custom Params type for route parameters, while chi integrates with the standard http.Request
  • chi offers more middleware and routing options, making it suitable for larger applications
  • httprouter focuses on simplicity and performance, making it ideal for smaller projects or microservices

Both routers are popular choices in the Go community, with httprouter being favored for its speed and simplicity, while chi is preferred for its flexibility and feature set.

33,019

⚡️ Express inspired web framework written in Go

Pros of Fiber

  • Extremely fast performance, often benchmarking higher than Chi
  • Built-in support for WebSocket, prefork, and server-side events
  • More extensive feature set out-of-the-box, including templating and middleware

Cons of Fiber

  • Larger dependency footprint due to its feature-rich nature
  • Not fully compatible with net/http, which may limit integration with some standard library features
  • Steeper learning curve for developers familiar with standard Go HTTP patterns

Code Comparison

Chi:

r := chi.NewRouter()
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("Welcome"))
})
http.ListenAndServe(":3000", r)

Fiber:

app := fiber.New()
app.Get("/", func(c *fiber.Ctx) error {
    return c.SendString("Welcome")
})
app.Listen(":3000")

Both Chi and Fiber are popular Go web frameworks, each with its own strengths. Chi focuses on simplicity and standard library compatibility, while Fiber emphasizes performance and feature richness. The choice between them often depends on specific project requirements and developer preferences.

21,607

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

Pros of fasthttp

  • Significantly higher performance and lower memory usage
  • Built-in support for HTTP/1.1 pipelining and keep-alive connections
  • Optimized for high-load scenarios and microservices

Cons of fasthttp

  • Less compatible with net/http standard library
  • Steeper learning curve due to its non-standard API
  • Limited middleware ecosystem compared to chi

Code Comparison

fasthttp:

func requestHandler(ctx *fasthttp.RequestCtx) {
    fmt.Fprintf(ctx, "Hello, world!")
}
fasthttp.ListenAndServe(":8080", requestHandler)

chi:

r := chi.NewRouter()
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("Hello, world!"))
})
http.ListenAndServe(":8080", r)

fasthttp focuses on raw performance, sacrificing some compatibility and ease of use. It's ideal for high-load scenarios where every microsecond counts. chi, on the other hand, provides a more familiar API that's compatible with net/http, making it easier to integrate with existing Go ecosystems and middleware. chi offers a good balance between performance and developer-friendly features, while fasthttp pushes the boundaries of HTTP performance at the cost of some convenience.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

chi

GoDoc Widget

chi is a lightweight, idiomatic and composable router for building Go HTTP services. It's especially good at helping you write large REST API services that are kept maintainable as your project grows and changes. chi is built on the new context package introduced in Go 1.7 to handle signaling, cancelation and request-scoped values across a handler chain.

The focus of the project has been to seek out an elegant and comfortable design for writing REST API servers, written during the development of the Pressly API service that powers our public API service, which in turn powers all of our client-side applications.

The key considerations of chi's design are: project structure, maintainability, standard http handlers (stdlib-only), developer productivity, and deconstructing a large system into many small parts. The core router github.com/go-chi/chi is quite small (less than 1000 LOC), but we've also included some useful/optional subpackages: middleware, render and docgen. We hope you enjoy it too!

Install

go get -u github.com/go-chi/chi/v5

Features

  • Lightweight - cloc'd in ~1000 LOC for the chi router
  • Fast - yes, see benchmarks
  • 100% compatible with net/http - use any http or middleware pkg in the ecosystem that is also compatible with net/http
  • Designed for modular/composable APIs - middlewares, inline middlewares, route groups and sub-router mounting
  • Context control - built on new context package, providing value chaining, cancellations and timeouts
  • Robust - in production at Pressly, Cloudflare, Heroku, 99Designs, and many others (see discussion)
  • Doc generation - docgen auto-generates routing documentation from your source to JSON or Markdown
  • Go.mod support - as of v5, go.mod support (see CHANGELOG)
  • No external dependencies - plain ol' Go stdlib + net/http

Examples

See _examples/ for a variety of examples.

As easy as:

package main

import (
	"net/http"

	"github.com/go-chi/chi/v5"
	"github.com/go-chi/chi/v5/middleware"
)

func main() {
	r := chi.NewRouter()
	r.Use(middleware.Logger)
	r.Get("/", func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("welcome"))
	})
	http.ListenAndServe(":3000", r)
}

REST Preview:

Here is a little preview of how routing looks like with chi. Also take a look at the generated routing docs in JSON (routes.json) and in Markdown (routes.md).

I highly recommend reading the source of the examples listed above, they will show you all the features of chi and serve as a good form of documentation.

import (
  //...
  "context"
  "github.com/go-chi/chi/v5"
  "github.com/go-chi/chi/v5/middleware"
)

func main() {
  r := chi.NewRouter()

  // A good base middleware stack
  r.Use(middleware.RequestID)
  r.Use(middleware.RealIP)
  r.Use(middleware.Logger)
  r.Use(middleware.Recoverer)

  // Set a timeout value on the request context (ctx), that will signal
  // through ctx.Done() that the request has timed out and further
  // processing should be stopped.
  r.Use(middleware.Timeout(60 * time.Second))

  r.Get("/", func(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("hi"))
  })

  // RESTy routes for "articles" resource
  r.Route("/articles", func(r chi.Router) {
    r.With(paginate).Get("/", listArticles)                           // GET /articles
    r.With(paginate).Get("/{month}-{day}-{year}", listArticlesByDate) // GET /articles/01-16-2017

    r.Post("/", createArticle)                                        // POST /articles
    r.Get("/search", searchArticles)                                  // GET /articles/search

    // Regexp url parameters:
    r.Get("/{articleSlug:[a-z-]+}", getArticleBySlug)                // GET /articles/home-is-toronto

    // Subrouters:
    r.Route("/{articleID}", func(r chi.Router) {
      r.Use(ArticleCtx)
      r.Get("/", getArticle)                                          // GET /articles/123
      r.Put("/", updateArticle)                                       // PUT /articles/123
      r.Delete("/", deleteArticle)                                    // DELETE /articles/123
    })
  })

  // Mount the admin sub-router
  r.Mount("/admin", adminRouter())

  http.ListenAndServe(":3333", r)
}

func ArticleCtx(next http.Handler) http.Handler {
  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    articleID := chi.URLParam(r, "articleID")
    article, err := dbGetArticle(articleID)
    if err != nil {
      http.Error(w, http.StatusText(404), 404)
      return
    }
    ctx := context.WithValue(r.Context(), "article", article)
    next.ServeHTTP(w, r.WithContext(ctx))
  })
}

func getArticle(w http.ResponseWriter, r *http.Request) {
  ctx := r.Context()
  article, ok := ctx.Value("article").(*Article)
  if !ok {
    http.Error(w, http.StatusText(422), 422)
    return
  }
  w.Write([]byte(fmt.Sprintf("title:%s", article.Title)))
}

// A completely separate router for administrator routes
func adminRouter() http.Handler {
  r := chi.NewRouter()
  r.Use(AdminOnly)
  r.Get("/", adminIndex)
  r.Get("/accounts", adminListAccounts)
  return r
}

func AdminOnly(next http.Handler) http.Handler {
  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    ctx := r.Context()
    perm, ok := ctx.Value("acl.permission").(YourPermissionType)
    if !ok || !perm.IsAdmin() {
      http.Error(w, http.StatusText(403), 403)
      return
    }
    next.ServeHTTP(w, r)
  })
}

Router interface

chi's router is based on a kind of Patricia Radix trie. The router is fully compatible with net/http.

Built on top of the tree is the Router interface:

// Router consisting of the core routing methods used by chi's Mux,
// using only the standard net/http.
type Router interface {
	http.Handler
	Routes

	// Use appends one or more middlewares onto the Router stack.
	Use(middlewares ...func(http.Handler) http.Handler)

	// With adds inline middlewares for an endpoint handler.
	With(middlewares ...func(http.Handler) http.Handler) Router

	// Group adds a new inline-Router along the current routing
	// path, with a fresh middleware stack for the inline-Router.
	Group(fn func(r Router)) Router

	// Route mounts a sub-Router along a `pattern`` string.
	Route(pattern string, fn func(r Router)) Router

	// Mount attaches another http.Handler along ./pattern/*
	Mount(pattern string, h http.Handler)

	// Handle and HandleFunc adds routes for `pattern` that matches
	// all HTTP methods.
	Handle(pattern string, h http.Handler)
	HandleFunc(pattern string, h http.HandlerFunc)

	// Method and MethodFunc adds routes for `pattern` that matches
	// the `method` HTTP method.
	Method(method, pattern string, h http.Handler)
	MethodFunc(method, pattern string, h http.HandlerFunc)

	// HTTP-method routing along `pattern`
	Connect(pattern string, h http.HandlerFunc)
	Delete(pattern string, h http.HandlerFunc)
	Get(pattern string, h http.HandlerFunc)
	Head(pattern string, h http.HandlerFunc)
	Options(pattern string, h http.HandlerFunc)
	Patch(pattern string, h http.HandlerFunc)
	Post(pattern string, h http.HandlerFunc)
	Put(pattern string, h http.HandlerFunc)
	Trace(pattern string, h http.HandlerFunc)

	// NotFound defines a handler to respond whenever a route could
	// not be found.
	NotFound(h http.HandlerFunc)

	// MethodNotAllowed defines a handler to respond whenever a method is
	// not allowed.
	MethodNotAllowed(h http.HandlerFunc)
}

// Routes interface adds two methods for router traversal, which is also
// used by the github.com/go-chi/docgen package to generate documentation for Routers.
type Routes interface {
	// Routes returns the routing tree in an easily traversable structure.
	Routes() []Route

	// Middlewares returns the list of middlewares in use by the router.
	Middlewares() Middlewares

	// Match searches the routing tree for a handler that matches
	// the method/path - similar to routing a http request, but without
	// executing the handler thereafter.
	Match(rctx *Context, method, path string) bool
}

Each routing method accepts a URL pattern and chain of handlers. The URL pattern supports named params (ie. /users/{userID}) and wildcards (ie. /admin/*). URL parameters can be fetched at runtime by calling chi.URLParam(r, "userID") for named parameters and chi.URLParam(r, "*") for a wildcard parameter.

Middleware handlers

chi's middlewares are just stdlib net/http middleware handlers. There is nothing special about them, which means the router and all the tooling is designed to be compatible and friendly with any middleware in the community. This offers much better extensibility and reuse of packages and is at the heart of chi's purpose.

Here is an example of a standard net/http middleware where we assign a context key "user" the value of "123". This middleware sets a hypothetical user identifier on the request context and calls the next handler in the chain.

// HTTP middleware setting a value on the request context
func MyMiddleware(next http.Handler) http.Handler {
  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    // create new context from `r` request context, and assign key `"user"`
    // to value of `"123"`
    ctx := context.WithValue(r.Context(), "user", "123")

    // call the next handler in the chain, passing the response writer and
    // the updated request object with the new context value.
    //
    // note: context.Context values are nested, so any previously set
    // values will be accessible as well, and the new `"user"` key
    // will be accessible from this point forward.
    next.ServeHTTP(w, r.WithContext(ctx))
  })
}

Request handlers

chi uses standard net/http request handlers. This little snippet is an example of a http.Handler func that reads a user identifier from the request context - hypothetically, identifying the user sending an authenticated request, validated+set by a previous middleware handler.

// HTTP handler accessing data from the request context.
func MyRequestHandler(w http.ResponseWriter, r *http.Request) {
  // here we read from the request context and fetch out `"user"` key set in
  // the MyMiddleware example above.
  user := r.Context().Value("user").(string)

  // respond to the client
  w.Write([]byte(fmt.Sprintf("hi %s", user)))
}

URL parameters

chi's router parses and stores URL parameters right onto the request context. Here is an example of how to access URL params in your net/http handlers. And of course, middlewares are able to access the same information.

// HTTP handler accessing the url routing parameters.
func MyRequestHandler(w http.ResponseWriter, r *http.Request) {
  // fetch the url parameter `"userID"` from the request of a matching
  // routing pattern. An example routing pattern could be: /users/{userID}
  userID := chi.URLParam(r, "userID")

  // fetch `"key"` from the request context
  ctx := r.Context()
  key := ctx.Value("key").(string)

  // respond to the client
  w.Write([]byte(fmt.Sprintf("hi %v, %v", userID, key)))
}

Middlewares

chi comes equipped with an optional middleware package, providing a suite of standard net/http middlewares. Please note, any middleware in the ecosystem that is also compatible with net/http can be used with chi's mux.

Core middlewares


chi/middleware Handlerdescription
AllowContentEncodingEnforces a whitelist of request Content-Encoding headers
AllowContentTypeExplicit whitelist of accepted request Content-Types
BasicAuthBasic HTTP authentication
CompressGzip compression for clients that accept compressed responses
ContentCharsetEnsure charset for Content-Type request headers
CleanPathClean double slashes from request path
GetHeadAutomatically route undefined HEAD requests to GET handlers
HeartbeatMonitoring endpoint to check the servers pulse
LoggerLogs the start and end of each request with the elapsed processing time
NoCacheSets response headers to prevent clients from caching
ProfilerEasily attach net/http/pprof to your routers
RealIPSets a http.Request's RemoteAddr to either X-Real-IP or X-Forwarded-For
RecovererGracefully absorb panics and prints the stack trace
RequestIDInjects a request ID into the context of each request
RedirectSlashesRedirect slashes on routing paths
RouteHeadersRoute handling for request headers
SetHeaderShort-hand middleware to set a response header key/value
StripSlashesStrip slashes on routing paths
SunsetSunset set Deprecation/Sunset header to response
ThrottlePuts a ceiling on the number of concurrent requests
TimeoutSignals to the request context when the timeout deadline is reached
URLFormatParse extension from url and put it on request context
WithValueShort-hand middleware to set a key/value on the request context

Extra middlewares & packages

Please see https://github.com/go-chi for additional packages.


packagedescription
corsCross-origin resource sharing (CORS)
docgenPrint chi.Router routes at runtime
jwtauthJWT authentication
hostrouterDomain/host based request routing
httplogSmall but powerful structured HTTP request logging
httprateHTTP request rate limiter
httptracerHTTP request performance tracing library
httpvcrWrite deterministic tests for external sources
stampedeHTTP request coalescer

context?

context is a tiny pkg that provides simple interface to signal context across call stacks and goroutines. It was originally written by Sameer Ajmani and is available in stdlib since go1.7.

Learn more at https://blog.golang.org/context

and..

Benchmarks

The benchmark suite: https://github.com/pkieltyka/go-http-routing-benchmark

Results as of Nov 29, 2020 with Go 1.15.5 on Linux AMD 3950x

BenchmarkChi_Param          	3075895	        384 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_Param5         	2116603	        566 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_Param20        	 964117	       1227 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_ParamWrite     	2863413	        420 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_GithubStatic   	3045488	        395 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_GithubParam    	2204115	        540 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_GithubAll      	  10000	     113811 ns/op	    81203 B/op    406 allocs/op
BenchmarkChi_GPlusStatic    	3337485	        359 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_GPlusParam     	2825853	        423 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_GPlus2Params   	2471697	        483 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_GPlusAll       	 194220	       5950 ns/op	     5200 B/op     26 allocs/op
BenchmarkChi_ParseStatic    	3365324	        356 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_ParseParam     	2976614	        404 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_Parse2Params   	2638084	        439 ns/op	      400 B/op      2 allocs/op
BenchmarkChi_ParseAll       	 109567	      11295 ns/op	    10400 B/op     52 allocs/op
BenchmarkChi_StaticAll      	  16846	      71308 ns/op	    62802 B/op    314 allocs/op

Comparison with other routers: https://gist.github.com/pkieltyka/123032f12052520aaccab752bd3e78cc

NOTE: the allocs in the benchmark above are from the calls to http.Request's WithContext(context.Context) method that clones the http.Request, sets the Context() on the duplicated (alloc'd) request and returns it the new request object. This is just how setting context on a request in Go works.

Credits

We'll be more than happy to see your contributions!

Beyond REST

chi is just a http router that lets you decompose request handling into many smaller layers. Many companies use chi to write REST services for their public APIs. But, REST is just a convention for managing state via HTTP, and there's a lot of other pieces required to write a complete client-server system or network of microservices.

Looking beyond REST, I also recommend some newer works in the field:

  • webrpc - Web-focused RPC client+server framework with code-gen
  • gRPC - Google's RPC framework via protobufs
  • graphql - Declarative query language
  • NATS - lightweight pub-sub

License

Copyright (c) 2015-present Peter Kieltyka

Licensed under MIT License