Spaces:
Running
Running
File size: 606 Bytes
07921ba 16c20b7 07921ba |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import WebDAVServer from "@filen/webdav"
//WebDAV主机名,如果需要禁止外网访问,请改成127.0.0.1
const hostname = "0.0.0.0"
//WebDAV端口,可改成其他端口
const port = 8080
//是否使用https,暂时不知道怎么配置证书,所以这里禁用了https
const https = false
const server = new WebDAVServer.default({
hostname,
port,
https,
authMode: "basic"
});
server
.start()
.then(() =>
console.log(`WebDAV 服务端正运行在 ${https ? "https" : "http"}://${hostname === "0.0.0.0" ? "local.webdav.filen.io" : hostname}:${port}`)
)
.catch(console.error) |