Live data from Hacker News

Ask HN: What Go framework for web API are you using in production?

news.ycombinator.com

51–60 of 65 posts

Re: Ask HN: What Go framework for web API are you using in production?

#51
post #12

We run grpc-web with a big single-page VueJS app on the frontend. That way, Go is just the Api server, and the frontend handles all the routing and stuff.

We will also try to go this path. What is your overall satisfaction with this approach? I saw that grpc-web is marked as alpha and the grpc team itself wants to implement something which is kind of comparable.

It's been good. I need to figure out SSR, either in Go or though a Node microservice.

I really like how a proto file defines our whole Api. It makes designing and referencing the Api easy.

Re: Ask HN: What Go framework for web API are you using in production?

#52

grpc-go ( https://github.com/grpc/grpc-go ) + grpc-gateway ( https://github.com/grpc-ecosystem/grpc-gateway )

Same here. I was sceptical about code generation and the whole protobuf as a base thing but i'm really liking it. Especially when you throw opentracing in the mix.

Re: Ask HN: What Go framework for web API are you using in production?

#54
The Go standard library has most of what you need for basic API servers. However as has been stated here, some things are not worth spending time crafting yourself.

Also for modern Docker/Kubernetes ops environments you need some additional infrastructure for table stakes. Here's my standard Nulladmin.com stack:

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

Command flags - https://github.com/spf13/pflag

Config - https://github.com/spf13/viper

Logging - https://github.com/Sirupsen/logrus

Metrics - https://github.com/prometheus/client_golang/prometheus

SQL helper - https://github.com/jmoiron/sqlx

OpenTracing - https://github.com/opentracing/opentracing-go

Re: Ask HN: What Go framework for web API are you using in production?

#58

https://github.com/ant0ine/go-json-rest

We use this too. It's not bad if all you're ever doing is returning json, but escaping from their `rest.ResponseWriter` to a normal `http.ResponseWriter` is always sad when you need to write out anything else.

That's a pretty good summary of the rest of it for me too...pretty good, but sad that it doesn't adhere to the standard libs `http` interfaces

Post reply on HN