box-o-sand/oldstuff/html5/server.go
2015-06-22 13:15:42 -05:00

23 lines
450 B
Go

// I wanted to practice, plus maaaaaybe I'll want something dynamic on the
// server side (???)
package main
import (
"flag"
"fmt"
"net/http"
)
var (
docroot = flag.String("d", ".", "docroot for server")
addr = flag.String("a", ":8990", "address on which to listen")
)
func main() {
flag.Parse()
http.Handle("/", http.FileServer(http.Dir(*docroot)))
fmt.Printf("Serving %q on %v\n", *docroot, *addr)
http.ListenAndServe(*addr, nil)
}