A quick HTTP fileserver
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
467 B

// Command quickserv serves a folder of files over HTTP quickly.
package main
import (
var (
port = flag.String("port", "3000", "port to use")
dir = flag.String("dir", ".", "directory to serve")
func main() {
http.Handle("/", http.FileServer(http.Dir(*dir)))
log.Printf("Serving %s on port %s", *dir, *port)
log.Fatal(http.ListenAndServe(":"+*port, nil))