Handling HTTP functions and Gorilla Mux
When we look at the Go standard library, we can see that a lot of thought has gone into the HTTP library. You can check out the documentation for the Go standard library here: https://pkg.go.dev/net/http. However, we’ll cover the foundations and look at how we can build upon them. It’s interesting to Note that the Go standard library covers both client- and server-side implementations. We will only be focusing on the parts we require to serve content.
We will create a simple app that replies with Hello, World, as well as look at returning POST
data once we have expanded our routes.
Hello, World with defaults
The basic concepts of creating a server in Golang are as follows:
1 package main 2 3 import ( 4 "...