2013-01-06 15:20:54 -08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
var addr = flag.String("addr", ":8000", "http service address")
|
2013-01-06 15:29:31 -08:00
|
|
|
var static_files = flag.String("static", "./static", "location of static files")
|
2013-01-06 15:20:54 -08:00
|
|
|
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
|
|
|
http.Handle("/s/", http.StripPrefix("/s/",
|
|
|
|
http.FileServer(http.Dir(*static_files))))
|
|
|
|
if err := http.ListenAndServe(*addr, nil); err != nil {
|
|
|
|
log.Fatal("ListenAndServe:", err)
|
|
|
|
}
|
|
|
|
}
|