A zero config WebDAV server

In this post, we will spinup a simple zero config webdav server which is open source and available from npm. This webdav server is a middleground between full fledge servers like nginx and apache and our 20 lines of code webdav testing server which we already covered in previous articles.

~/$ npm install --global webdav-cli
/home/mickael/.nvm/versions/node/v14.0.0/bin/webdav-cli -> /home/mickael/.nvm/versions/node/v14.0.0/lib/node_modules/webdav-cli/dist/webdav-cli.cli.js
+ webdav-cli@2.0.0
added 15 packages from 14 contributors in 7.648s
~/$ npx webdav-cli

                    _           _                                  _   _ 
 __      __   ___  | |__     __| |   __ _  __   __           ___  | | (_)
 \ \ /\ / /  / _ \ | '_ \   / _` |  / _` | \ \ / /  _____   / __| | | | |
  \ V  V /  |  __/ | |_) | | (_| | | (_| |  \ V /  |_____| | (__  | | | |
   \_/\_/    \___| |_.__/   \__,_|  \__,_|   \_/            \___| |_| |_|

Homepage: https://github.com/svtslv/webdav-cli

Server running at http://127.0.0.1:1900
[rights]: all
[digest]: false
username: domdhtgnqljs5snm
password: xq9u5r3ilgmai548
Hit CTRL-C to stop the server
Run with --help to print help</br>

By default, it will give you a username and password which you can use to connect and do whatever you want. Among the nice things are the quick configuration options which you can enable via the CLI:

~/$ npx webdav-cli --help

                    _           _                                  _   _ 
 __      __   ___  | |__     __| |   __ _  __   __           ___  | | (_)
 \ \ /\ / /  / _ \ | '_ \   / _` |  / _` | \ \ / /  _____   / __| | | | |
  \ V  V /  |  __/ | |_) | | (_| | | (_| |  \ V /  |_____| | (__  | | | |
   \_/\_/    \___| |_.__/   \__,_|  \__,_|   \_/            \___| |_| |_|

Homepage: https://github.com/svtslv/webdav-cli

usage: webdav-cli [options]

options:
  --path       Path to folder [process.cwd()]
  --host       Host to use [127.0.0.1]
  --port       Port to use [1900]
  --digest     Enable digest authentication [basic]
  --username   Username for basic/digest authentication [random]
  --password   Password for basic/digest authentication [random]
  --directory  Show directory listings [false]
  --autoIndex  Display autoIndex [false]
  --ssl        Enable https [false]
  --sslKey     Path to ssl key file [self-signed]
  --sslCert    Path to ssl cert file [self-signed]
  --help       Print this list and exit
  --version    Print the version and exit.
  --rights     Comma separated values without spaces [all]

    'all', 'canCreate', 'canDelete', 'canMove', 'canRename', 
    'canAppend', 'canWrite', 'canRead', 'canSource', 
    'canGetMimeType', 'canGetSize', 'canListLocks', 
    'canSetLock', 'canRemoveLock', 'canGetAvailableLocks', 
    'canGetLock', 'canAddChild', 'canRemoveChild', 
    'canGetChildren', 'canSetProperty', 'canGetProperty', 
    'canGetProperties', 'canRemoveProperty', 'canGetCreationDate', 
    'canGetLastModifiedDate', 'canGetWebName', 'canGetType'

env:
  WEBDAV_CLI_PATH, WEBDAV_CLI_HOST, WEBDAV_CLI_PORT,
  WEBDAV_CLI_USERNAME, WEBDAV_CLI_PASSWORD, WEBDAV_CLI_DIGEST,
  WEBDAV_CLI_SSL, WEBDAV_CLI_SSL_KEY, WEBDAV_CLI_SSL_CERT,
  WEBDAV_CLI_DIRECTORY, WEBDAV_CLI_AUTO_INDEX, WEBDAV_CLI_RIGHTS
  WEBDAV_CLI_DISABLE_AUTHENTICATION

To get further, check out their github repo