// this defines the entry point
package main
// import formatting and HTTP server packages
import (
"fmt"
"net/http"
)
// This is your HTTP Server instance
type Hello struct{}
// This is a method on your HTTP server instance that sends hello for all requests
func (h Hello) ServeHTTP(
w http.ResponseWriter,
r *http.Request) {
fmt.Fprint(w, "Hello!")
}
// this is your entry point
func main() {
// create a new HTTP Server instance
var h Hello
// tell the runtime to serve it
http.ListenAndServe("localhost:4000",h)
}
So is there anywhere I can see an example of code that runs a server like this?