pouchdb / pouchdb-server

CouchDB-compatible server built on PouchDB and Node
Apache License 2.0
948 stars 154 forks source link

Fauxton only works on "/" route.. #256

Open KpjComp opened 7 years ago

KpjComp commented 7 years ago

If you try and say setup an express route like '/db',

then go to '/db/_utils' you get a totally broken webpage, adding an extra '/' eg. '/db/_utils/', partly gets you there. But then you get console errors because the fauxton interface is doing requests like '/_session', instead of '/db/_session'.

It looks like some urls inside the fauxton interface are absolute, but really want to be relative.

Also the redirect I think needs a little tweak.->

if (req.originalUrl === '/_utils') {
     res.redirect(301, '/_utils/');

edit: Looking at this, I believe it's more of a couchdb-fauxton problem, as I've compiled the couchdb-fauxton-master same problem, and it has things like -> I can hack it to work bit by bit, but I think I'm best reporting this to couchdb-fauxton-master..

return window.location.origin + '/_all_dbs';

That of course is only going to work if the files are mounted at '/'.. :(

MichaelJCole commented 7 years ago

See: https://github.com/pouchdb/pouchdb-server/issues/180