示例#1
0
func main() {
	flag.Parse()
	if len(flag.Args()) > 0 {
		log.Fatalln("Extra command line arguments", flag.Args())
	}
	addr := fmt.Sprintf("%s:%d", *host, *port)
	storage := local.LocalStorage{*storage_dir}
	server.Setup(*static_data_dir, *poll_delay,
		func(*http.Request) server.SaveLoader { return &storage })
	log.Println("Binding to address:", addr)
	log.Fatalln(http.ListenAndServe(addr, nil))
}
示例#2
0
func init() {
	server.Setup("", 55, get_datastore)
}