{ "name": "webdav-one", "version": "1.0.0", "type": "commonjs", "main": "server.js", "scripts": { "start": "node server.js" }, "dependencies": { "express": "^4.18.2", "webdav-server": "^2.5.0" }, "engines": { "node": ">=18" } } { "name": "webdav-two", "version": "1.0.0", "type": "commonjs", "description": "Minimal WebDAV server using Node.js and Express", "main": "server.js", "scripts": { "start": "node server.js" }, "dependencies": { "express": "^4.18.4", "basic-auth": "^2.0.1" }, "engines": { "node": ">=18" } } { "name": "echo-server", "version": "1.0.0", "main": "server.js", "scripts": { "start": "node server.js" }, "dependencies": { "express": "^4.21.2" }, "engines": { "node": "16.x" } } Yes — you can absolutely use app.use(...) instead of app.all(...) for WebDAV methods like COPY. They are functionally equivalent if you're doing manual req.method checks inside. These are equivalent: // Using app.all app.all('/*', (req, res, next) => { if (req.method !== 'COPY') return next() // handle COPY... }) // Or Using app.use app.use((req, res, next) => { if (req.method !== 'COPY') return next() // handle COPY... }) Express only provides route methods for the standard HTTP methods defined in the HTTP/1.1 spec: Built-in Express method Purpose app.get() Retrieve data app.post() Submit data app.put() Replace data app.delete() Delete data app.patch() Partial update app.options() Preflight app.head() Headers only app.all() Any of the above What about WebDAV methods like PROPFIND, MKCOL, MOVE, COPY, etc.? These are not natively supported as top-level methods in Express. To handle them, you have to use app.use(...) or app.all(...) Middleware: Think of it like a filter or pipeline Each request flows through the middleware stack. Each function can: - read from the request (req) - modify the response (res) - terminate the request (by sending a response directly) - or pass control to the next middleware with next() cat cpanel-server-2.js | grep ^app app.use((req, res, next) => { app.options('/*', (req, res) => { app.use((req, res, next) => { app.use(express.raw({ type: '*/*' })) app.get('/*', (req, res) => { app.put('/*', (req, res) => { app.delete('/*', (req, res) => { app.use((req, res, next) => { app.all('/*', (req, res, next) => { app.all('/*', (req, res, next) => { app.all('/*', (req, res, next) => { app.use((req, res) => { app.listen(port, () => { const url = new URL(req.url) const path = url.pathname -> const path = new URL(req.url).pathname