This is an automated email from the ASF dual-hosted git repository. janl pushed a commit to branch fix/paths in repository https://gitbox.apache.org/repos/asf/couchdb-fauxton.git
commit 1f7ca98a61afa5477f9eee0c594ac5c9803f3c0f Author: Jan Lehnardt <[email protected]> AuthorDate: Sun Oct 25 12:34:29 2026 +0100 fix: simplify path handling --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 9846388d..6e4e2fad 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ module.exports = function (options) { var proxyUrl = options.couchdb; function sendFile (req, res, filePath) { - return send(req, filePath) + return send(req, filePath, { root: dist_dir }) .on('error', function (err) { if (err.status === 404) { console.error('Could not locate', filePath); @@ -56,9 +56,9 @@ module.exports = function (options) { if (url === '/' && accept[0] !== 'application/json') { // serve main index file from here - return sendFile(req, res, path.join(dist_dir, 'index.html')); + return sendFile(req, res, 'index.html'); } else if (isFile(url) && !isDocLink) { - return sendFile(req, res, path.join(dist_dir, url)); + return sendFile(req, res, url); } // This sets the Host header in the proxy so that one can use external
