mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 01:37:52 +02:00
the most basic dav (#218)
This commit is contained in:
parent
2d6cd3a6ae
commit
6b378c5cc3
25
cmd/drive/main.go
Normal file
25
cmd/drive/main.go
Normal file
@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"golang.org/x/net/webdav"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
dav := &webdav.Handler{
|
||||
FileSystem: webdav.Dir("."),
|
||||
LockSystem: webdav.NewMemLS(),
|
||||
Logger: func(r *http.Request, err error) {
|
||||
if err != nil {
|
||||
log.Printf("WEBDAV [%s]: %s, ERROR: %s\n", r.Method, r.URL, err)
|
||||
} else {
|
||||
log.Printf("WEBDAV [%s]: %s \n", r.Method, r.URL)
|
||||
}
|
||||
},
|
||||
}
|
||||
http.Handle("/", dav)
|
||||
if err := http.ListenAndServe("0.0.0.0:8800", nil); err != nil {
|
||||
log.Fatalf("error serving: ")
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user