I'm trying to display a static page with GO.
GO:
package main
import "net/http"
func main() {
fs := http.FileServer(http.Dir("static/home"))
http.Handle("/", fs)
http.ListenAndServe(":4747", nil)
}
Directory:
Project
/static
home.html
edit.html
project.go
When I run it, the web page displays the links to edit.html and home.html instead of displaying the static page from home.html. What am I doing wrong. Is this the best way to serve files? I know there are other ways eg. from the html/templates package but I'm not sure what the difference is and when to use each of these methods. Thanks!