pouchdb / pouchdb-server

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

Can't make Fauxton work.... #260

Open jefBinomed opened 7 years ago

jefBinomed commented 7 years ago

Hi, i still don't understand what I have done wrong, I read all the issues about fauxton and pouchdb but i don't understand how it could help me... I'm a newbee in couchdb world so i don't really understand what I'm doing....

Here is my needs, I have a node server that expose a pouchdb database and I just want to simply see the object in it with fauxton.

I follow this issue https://github.com/pouchdb/express-pouchdb/issues/290 that give me a this view :

image

But I have always a blank screen... still no database available.

Here is my code :

const TAG = "DataBase Server Error : ";

/**
 * Initialize Database server
 */
const PORT = process.env.PORT || 3000;
const DB_URL = '/db';

const dbModule = require('./modules/db-module.js');
const express = require('express');
const app = express();
const PouchDB = require('pouchdb');
const pouchRouter = require('express-pouchdb');
const path = require('path')
const url = require('url')

// Here is the code where I create my dataBase with a db = new Pouch('./databaseName')
const dataBasePouch = dbModule.init(PouchDB, false);
const pouchHandle = pouchRouter(PouchDB, {
    overrideMode: {
        include: ['routes/fauxton']
    }
});
const fauxtonIntercept = (req, res, next) => {
    let referer = req.header('Referer');
    if (!referer) return next();

    let parsed = url.parse(referer);
    if (0 === parsed.pathname.indexOf(path.join(DB_URL, '/_utils/'))) {
        return pouchHandle(req, res);
    }
    return next();
};

app.use(DB_URL, pouchHandle);
app.use(fauxtonIntercept);

app.listen(PORT);
console.log(`app listening on ${PORT}`);

I saw that there is the pouchdb-fauxton project but i don't understand how he can helps me....

Can someone help me to visualize my datas ?

natew commented 6 years ago

Ah, stuck on this step as well now after fixing the fauxton asset route problem.

Edit for more information:

No console errors at all.

Ciebiada commented 6 years ago

Any progress?

newtonmunene99 commented 6 years ago

Did anyone find a solution?

QuentinRoy commented 6 years ago

pouchdb-fauxton does not work currently when not attached to the root. There is no workaround other than mounting it at / yet. C.f. #183.

kkitay commented 5 years ago

hi, this is still happening despite it seemingly having been fixed (?): https://github.com/apache/couchdb-fauxton/issues/944

are there any takeaways on how to make this work? i'm using the latest of everything.