okay one last post, you gotta see this tho.
/////////
package main
import (
"log"
"net/http"
)
func main() {
fs := http.FileServer(http.Dir("./static"))
http.Handle("/", fs)
log.Println("Listening on :8080...")
err := http.ListenAndServe(":8080", nil)
if err != nil {
log.Fatal(err)
}
}
//////////
the above code is a .go file. Name it like main.go, the compile it into a standalone executable by "go build main.go" then run the executable with "./main" or "go run main"
Jesus, this is cool. You make a directory called /static and then ANY files or even entire directories that you put into the static dir show up!!!! your browser lands on a page that just lists whatever you have in your static dir, it will list the files or even directories in the static directory. You CAN hot swap... keep the go prog running and add files or directories to the /static directory and refresh the browser and the new files or directories show up!!!!!!!! That is insane functionality for a couple lines of code. Like WOW.