A
A
Adatan2020-02-27 16:44:43
go
Adatan, 2020-02-27 16:44:43

What is the best router for Golang server?

Recommend a convenient router for Golang, personally familiar only with gin and Gorilla / mux.
Together with the router will use GraphQL

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Andrey Tsvetkov, 2020-02-27
@yellow79

Why does graphql need a router? There is also one static route. Use
http.HandleFunc("/graphql", graphqlHandler)

A
akaKAIN, 2020-02-28
@akaKAIN

Taste of course:
https://github.com/vardius/gorouter
https://github.com/goji/goji

F
falconandy, 2020-02-28
@falconandy

https://github.com/go-chi/chi

A
Alexander Melentyev, 2020-03-01
@asmelentyev

In my projects I use Mux from Gorilla or Chi . I like the latter more, because of the design of group routes, for example:

r.Route(fmt.Sprintf("/%s", "manage"), func(r chi.Router) {
  r.Handle("/prometheus", promhttp.Handler())
  r.Get("/health", controllers.Health)
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question