Which web framework is best for REST API on production level?


(Taalhach) #1

Hi
i am working with a company that is looking for a web framework to use it on production level our needs are
-REST apis
-Rapid development
-Stable framework
please recommend me best framework and please don’t suggest to use std/lib because RAPID development is our first priority
Thanks


(Sebastian Hennebrueder) #2

I found the following frameworks being referenced a lot
http://www.gorillatoolkit.org/pkg/mux


https://iris-go.com/ (See and validate the discussion below on Iris before choosing it)
https://github.com/urfave/negroni Middleware

The folloing libraries help you reload your webservice for faster development.



(Yamil Bracho) #3

You can find a excelent list of tools and libraries for Go in https://github.com/avelino/awesome-go


(Johan Dahl) #4

Hi

Gin is very popular 25k stars on github and a lot of activity


(Boban Acimovic) #6

@laliluna, there is an old no-no for Iris:


(Ignacio Gómez) #7

There’s also more recent reports about it too and they are still bad:


(LI YUQING) #8

I’m writing an open source forum without framework and ORM, maybe you will like it.


(Ralph Jackson) #9

My first REST server development in Go used the go-swagger tool - here is a excerpt from one of our repos README file (names changed to use example).

[Swagger](https://github.com/go-swagger/go-swagger) tool was used to generate this server.
Since the tool only supports v2 of the swagger spec, that version must be used when generating

[Install Swagger](https://goswagger.io/install.html)

```bash
$ swagger generate server --target . --name example --spec example.2.0.yaml

$ tree -d
.
├── cmd
│   └── example-server
├── models
├── restapi
│   └── operations
│       └── example

You can easily update your API file and regenerate the server. Of course, you still have to create handlers to implement your logic.

Some of my colleges are have also used: https://github.com/protocolbuffers/protobuf
Specifically for Go: https://github.com/golang/protobuf

We are able to generate a server that handles both REST and gRPC, which may be of interest to you.


(Ouanis Seddaoui) #11

Maybe worth adding an edit to your post @laliluna to point here. Just to make sure people who don’t read further than the first answer are aware of the issues associated with the Iris’s maintainer :slight_smile:


(Kaveh Shahbazian) #12

I recommend echo. It is open source and packtpub published a book on how to use and learn it. It can be used for implementing both Web Apps and Web APIs - including REST.

If the goal is to develop just an API, I recommend goa. It is an open source framework that takes a design first approach for designing API. It also generates the swagger documentation automatically, from those APIs, which are described in a DSL, which itself is Go (the DSL is not a home-made language or yaml).

The goa approach might look a bit too much work, but I recommend to use it. When you reach around seven endpoints in your API, your future self will thank you! Yet again it all comes down to the problem at hand, the requirements and your resources.


(Nima Ghoroubi) #13

These 2 frameworks are most popular for production level.
Echo has many useful middlewares


(Just Code It) #14

It’s sad that https://beego.me/ is not mentioned. It can also be used for production level.


(Taalhach) #15

Thank you. i need production level tool


(Taalhach) #16

Thankyou man for your response :slight_smile: