API rest: standard library or framework?


(Hugo) #1

Good afternoon,

I have been looking at answers about whether or not to use a framework to develop an API with Golang. The truth is, I’m a little confused.

In my work I am using Golang to implement scripts of all kinds for a couple of months now. But now, personally, I wanted to continue learning on my own and take it to the web. As I believe that there is no better way to learn than by setting a project in motion, that is what I was trying to do.

But after reading, taking a course, etc. I start to have doubts if I have the level to do it correctly. I have done APIs with Java and Python. And I have developed websites with different frameworks. I wanted to make use of Golang because I think its characteristics are impressive.

My question is: do I have to choose a framework to make an API subtraction or do I just use the standard library? If using a framework, which one would you use? I would like it to be in line with GO’s philosophy.

Thank you very much and excuse my ignorance.


(Ivan Matmati) #2

If I had to go with a framework (and it’s a good idea), I’d go with Gorilla Mux :https://github.com/gorilla/mux
Its API provides a lot of advantages. Look at https://www.alexedwards.net/blog/a-mux-showdown


(Hugo) #3

Thank you very much for your answer. I’ll give gorilla mux a chance.

And about the technology to use on the client side, based on your experience, you recommend VueJS, Angular or directly html css and javascript?

Thank you very much again.


(Ivan Matmati) #4

I’m a React guy ! So my answer is pretty obvious.But in second choice, I would choose Angular.


(framp) #5

I’ve written already multiple REST APIs using gin which is a very nice framework.


(Onezino Moreira) #6

What I suggest is take a look in go-kit. It takes a architectural approach that guide you to build a robust or simple apis.