Last active
May 10, 2022 19:16
-
-
Save mickael-kerjean/f2f034bdad5e077edcbfdff649d52d68 to your computer and use it in GitHub Desktop.
minimal webdav server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// go mod init example.com && go get . | |
// CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o webdav.bin main.go | |
package main | |
import ( | |
"fmt" | |
"github.com/google/go-webdav" | |
"github.com/google/go-webdav/memfs" | |
"net/http" | |
) | |
func main() { | |
srv := webdav.NewWebDAV(memfs.NewMemFS()) | |
fmt.Printf("Running server on http://localhost:8080/\n") | |
err := http.ListenAndServe(":8080", srv) | |
if err != nil { | |
fmt.Printf("Issue while running the server %s", err.Error()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment