Best way to organize simple web API server?

Most of my experience as a developer is making CRUD web API servers in C#. I organize them using the Model-View-Controller structure, often with a Repository layer for MySQL queries.

In learning Go, I have learned that the MVC pattern is not recommended in Go (link). Instead, I’m supposed to use ‘package-oriented design’. However, I feel like the examples I have found are designed for larger applications than what I want to start out building.

What sort of design do you use for simple servers? Is there a pattern you keep coming back to?

1 Like

Well i m here for the same…Hopefully someone will post an accurate solution here.

It’s my first time developing an API server (personal project) and I’m currently following the Standard Package Layout approach discussed by Ben Johnson.

1 Like

Have a look at this code: https://github.com/santosh/bookstore-api/blob/master/main.go

It will answer some of your questions. I am also learning golang, so what are thoughts on it?