taito0 commited on
Commit
07921ba
·
verified ·
1 Parent(s): ab7aba0

Update start.mjs

Browse files
Files changed (1) hide show
  1. start.mjs +18 -19
start.mjs CHANGED
@@ -1,20 +1,19 @@
1
- // Proxy mode, multi user
2
-
3
- import { WebDAVServer } from "@filen/webdav";
4
-
5
- const hostname = "0.0.0.0";
6
- const port = 8080;
7
- const https = false;
8
- const server = new WebDAVServer({
9
- hostname,
10
- port,
11
- https,
12
- // Omit the user object
13
- authMode: "basic" // Only basic auth is supported in proxy mode
14
  });
15
-
16
- await server.start();
17
-
18
- console.log(
19
- `WebDAV server started on ${https ? "https" : "http"}://${hostname === "0.0.0.0" ? "local.webdav.filen.io" : hostname}:${port}`
20
- );
 
1
+ import WebDAVServer from "@filen/webdav"
2
+ //WebDAV主机名,如果需要禁止外网访问,请改成127.0.0.1
3
+ const hostname = "0.0.0.0"
4
+ //WebDAV端口,可改成其他端口
5
+ const port = 8080
6
+ //是否使用https,暂时不知道怎么配置证书,所以这里禁用了https
7
+ const https = false
8
+ const server = new WebDAVServer.default({
9
+ hostname,
10
+ port,
11
+ https,
12
+ authMode: "basic"
 
13
  });
14
+ server
15
+ .start()
16
+ .then(() =>
17
+ console.log(`WebDAV 服务端正运行在 ${https ? "https" : "http"}://${hostname === "0.0.0.0" ? "local.webdav.filen.io" : hostname}:${port}`)
18
+ )
19
+ .catch(console.error)