-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserve.js
More file actions
22 lines (17 loc) · 724 Bytes
/
Copy pathserve.js
File metadata and controls
22 lines (17 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const express = require('express');
const webdav = require('webdav-server').v2;
const app = express();
app.use(express.static('dist'));
app.get('/', function (req, res) {
res.sendFile(__dirname + "/dist/" + "index.html" );
})
// Mount the WebDAVServer instance
const webdav_server = new webdav.WebDAVServer();
webdav_server.setFileSystem('', new webdav.PhysicalFileSystem(__dirname + "/dav-root"));
app.use(webdav.extensions.express('/dav', webdav_server));
var server = app.listen(8081, function () {
var host = server.address().address
var port = server.address().port
console.log("Web server listening at http://%s:%s", host, port)
console.log("WebDav mount point at http://%s:%s/dav", host, port)
})