You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
450 B

// 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)
}