aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristine Dodrill <xena@yolo-swag.com>2015-09-01 12:48:28 -0700
committerChristine Dodrill <xena@yolo-swag.com>2015-09-01 12:48:28 -0700
commit359b838e78c6f85f54ca105feada0da99019f2e9 (patch)
tree4bb1f03d74c04d97b47cdf13fdead311725c9646
parentf10616980096344cb1c6c4897c705c72c7d00f74 (diff)
downloadx-359b838e78c6f85f54ca105feada0da99019f2e9.tar.xz
x-359b838e78c6f85f54ca105feada0da99019f2e9.zip
have directory setting, some semblance of logging
-rw-r--r--quickserv/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/quickserv/main.go b/quickserv/main.go
index 42a52e9..f7510af 100644
--- a/quickserv/main.go
+++ b/quickserv/main.go
@@ -2,15 +2,18 @@ package main
import (
"flag"
+ "log"
"net/http"
)
var (
port = flag.String("port", "3000", "port to use")
+ dir = flag.String("dir", ".", "directory to serve")
)
func main() {
flag.Parse()
- http.Handle("/", http.FileServer(http.Dir(".")))
+ http.Handle("/", http.FileServer(http.Dir(*dir)))
+ log.Printf("Serving %s on port %s", *dir, *port)
http.ListenAndServe(":"+*port, nil)
}