I have an experimental http service with two endpoints ("/" and"/heartbeat") on one port and graceful shutdown working well enough. I can’t figure out how to move the “/heartbeat” end point to another port.
You set the port the http.Server binds to to 8080. If you want to bind to a second port, you will have to start a second server.
Note that m.HandleFunc("/", TestEndpoint) matches every URL that is not otherwise matched. If you want to match exactly /, you have to check this. See https://golang.org/pkg/net/http/#example_ServeMux_Handle for how this can be done.