This is the simplest way to create a local server to serve local files
package main
import (
"log"
"net/http"
)
func main() {
fs := http.FileServer(http.Dir("."))
http.Handle("/", http.StripPrefix("/", fs))
log.Fatal(http.ListenAndServeTLS(":5000", nil))
}
Just run it:
$ go run main.go
And access through browser: http://localhost:5000