February 2020
Intermediate to advanced
404 pages
8h 42m
English
Accepting HTTP requests is the primary goal of a web server. In Go, there is a system-level package that helps developers create HTTP servers and clients. The name of the package is net/http. We can understand the functionality of the net/http package by creating a small example. The example accepts an incoming request and returns the timestamp of the server. Let us see the steps for creating such a server:
touch -p $GOPATH/src/github.com/git-user/chapter2/healthCheck/main.go
Now, we have a file where we can develop a server with a Health Check API that returns a date/time string.
Read now
Unlock full access