January 2020
Intermediate to advanced
640 pages
16h 56m
English
Nowadays, building RESTful APIs in Go is a fairly streamlined process. If you don't mind a little bit of elbow grease (for example, using regular expressions to manually extract parameters from request paths), you can build your very own HTTP router by leveraging the functionality offered by http.Mux, a component that ships with the Go standard library.
While building your own router from scratch would undoubtedly be a great learning experience, you should probably save quite a bit of time (and effort) and simply use one of the popular, battle-tested router packages such as gorilla-mux [5] or HttpRouter [3].
On the other hand, if fully-fledged web frameworks (combining a router, middleware, and perhaps an ORM into ...