Hello World
First, create a Handler which receives all incomming HTTP connections from browsers, HTTP clients or API requests. A handler in Go is a function with this signature:
- An which is where you write your text/html response to.
Registering a request handler to the default HTTP Server is as simple as this:
The following code will start Go’s default HTTP server and listen for connections on port 80. You can navigate your browser to and see your server handing your request.