2019-07-23 07:58:43 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-07-24 10:42:24 +03:00
|
|
|
"flag"
|
|
|
|
"log"
|
|
|
|
"net/http"
|
2019-07-23 07:58:43 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2019-07-24 10:42:24 +03:00
|
|
|
listen = flag.String("listen", ":8080", "listen address")
|
|
|
|
dir = flag.String("dir", ".", "directory to serve")
|
2019-07-23 07:58:43 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2019-07-24 10:42:24 +03:00
|
|
|
flag.Parse()
|
|
|
|
log.Printf("listening on %q...", *listen)
|
|
|
|
log.Fatal(http.ListenAndServe(*listen, http.FileServer(http.Dir(*dir))))
|
|
|
|
}
|