webfs/cmd/webfs/main.go

21 lines
371 B
Go
Raw Normal View History

2023-03-04 11:17:11 -07:00
package main
import (
"flag"
"golang.org/x/net/webdav"
"log"
"net/http"
)
func main() {
address := flag.String("a", "localhost:8080", "Address to listen to.")
flag.Parse()
2023-03-04 11:49:39 -07:00
handler := &webdav.Handler{}
2023-03-04 11:17:11 -07:00
handler.FileSystem = webdav.Dir(".")
handler.LockSystem = webdav.NewMemLS()
log.Println("Listening on", *address)
http.ListenAndServe(*address, handler)
}