From b5262d077f4c3ad482919566040bf77febca0128 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 17 Jan 2021 23:10:55 +0100 Subject: [PATCH] . --- config/srvconfig.json | 4 ++-- config/users.json | 11 +++++++++++ src/index.ts | 18 ++++++++++++------ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/config/srvconfig.json b/config/srvconfig.json index cb3c232..780a225 100644 --- a/config/srvconfig.json +++ b/config/srvconfig.json @@ -6,7 +6,7 @@ "Movies": "/media/hd1/Movies", "Pictures": "/media/hd1/Bilder", "Books": "/media/hd1/Books", - "EBooks": "/media/hd1/EBooks" - + "EBooks": "/media/hd1/EBooks", + "Kps": "/media/hd1/Kps" } } \ No newline at end of file diff --git a/config/users.json b/config/users.json index d9374d5..43799a8 100644 --- a/config/users.json +++ b/config/users.json @@ -9,4 +9,15 @@ "Movies": ["canRead", "canReadContent"], "Music": ["canRead", "canReadContent"] } +}, { + "username": "michael", + "password": "ma20041963", + "access": { + "Movies": ["canRead", "canReadContent"], + "Music": ["canRead", "canReadContent"], + "Pictures": ["canRead", "canReadContent"], + "Books": ["canRead", "canReadContent"], + "EBooks": ["canRead", "canReadContent"], + "Kps": ["canRead", "canReadContent", "canWrite", "canWriteContent"] + } }] \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 7a845d2..9058717 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,15 +64,21 @@ const serverOptions: webdav.WebDAVServerOptions = { const server = new webdav.WebDAVServer(serverOptions); -/* -server.afterRequest((arg, next) => { - // Display the method, the URI, the returned status code and the returned message - console.log('>>', arg.request.method, arg.requested.uri, '>', arg.response.statusCode, arg.response.statusMessage); + +server.afterRequest((_arg, next) => { + // Display the method, the URI, the returned status code and the returned message + /* + console.log( + 'METHOD', _arg.request.method, + 'URI', _arg.requested.uri, + 'RESPONSE.StatusCode', _arg.response.statusCode, + 'RESPONSE.StatusCode', _arg.response.statusMessage); // If available, display the body of the response - console.log(arg.responseBody); + console.log('RESPONSEBODY', _arg.responseBody); + */ next(); }); -*/ + let nMount = 0;