maze.io/http.go
2024-06-20 17:28:02 +02:00

22 lines
332 B
Go

package main
import (
"flag"
"log"
"net/http"
)
func main() {
addr := flag.String("addr", ":3000", "listen address")
flag.Parse()
fs := http.FileServer(http.Dir("./"))
http.Handle("/", fs)
log.Print("Listening on http://" + *addr + "/ ...")
err := http.ListenAndServe(*addr, nil)
if err != nil {
log.Fatal(err)
}
}