1 2 3 4 5 6 7 8 9 10 11 12 13
package main import ( "log" "net/http" ) func main() { http.Handle("/", http.StripPrefix("/", http.FileServer(http.Dir(".")))) if err := http.ListenAndServe(":8080", nil); err != nil { log.Fatal("ListenAndServe: ", err) } }
You can clone a snippet to your computer for local editing. Learn more.