2021-03-01 18:04:59 +00:00
|
|
|
package webdav
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/distribyted/distribyted/fs"
|
2021-03-10 09:54:56 +00:00
|
|
|
"github.com/rs/zerolog/log"
|
2021-03-01 18:04:59 +00:00
|
|
|
)
|
|
|
|
|
2021-04-04 17:24:58 +00:00
|
|
|
func NewWebDAVServer(fs fs.Filesystem, port int) error {
|
2021-03-10 09:54:56 +00:00
|
|
|
log.Info().Str("host", fmt.Sprintf("0.0.0.0:%d", port)).Msg("starting webDAV server")
|
2021-04-04 17:24:58 +00:00
|
|
|
return http.ListenAndServe(fmt.Sprintf("0.0.0.0:%d", port), newHandler(fs))
|
2021-03-01 18:04:59 +00:00
|
|
|
}
|