This commit is contained in:
google-labs-jules[bot] 2026-04-23 18:58:04 +00:00 committed by GitHub
commit 465d1ded47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 1715 additions and 9 deletions

31
examples/webdav/main.go Normal file
View file

@ -0,0 +1,31 @@
package main
import (
"log"
"os"
"time"
"github.com/infinite-iroha/touka"
"github.com/infinite-iroha/touka/webdav"
)
func main() {
r := touka.Default()
// Create a directory for the OS file system.
if err := os.MkdirAll("public", 0755); err != nil {
log.Fatal(err)
}
// Serve the "public" directory on the "/webdav/" route.
closer, err := webdav.Serve(r, "/webdav", "public")
if err != nil {
log.Fatal(err)
}
defer closer.Close()
log.Println("Touka WebDAV Server starting on :8080...")
if err := r.RunShutdown(":8080", 10*time.Second); err != nil {
log.Fatalf("Touka server failed to start: %v", err)
}
}