Open maxkfranz opened 5 years ago
The example in the readme:
If you want express-pouchdb to proxy requests to another CouchDB-style HTTP API, you can use http-pouchdb: var TempPouchDB = require('http-pouchdb')(PouchDB, 'http://localhost:5984'); app.use('/db', require('express-pouchdb')(TempPouchDB));
If you want express-pouchdb to proxy requests to another CouchDB-style HTTP API, you can use http-pouchdb:
var TempPouchDB = require('http-pouchdb')(PouchDB, 'http://localhost:5984'); app.use('/db', require('express-pouchdb')(TempPouchDB));
Running the example verbatim, localhost:5984 does not work. However, localhost:5984/ does work.
localhost:5984
localhost:5984/
See this line: https://github.com/pouchdb/pouchdb-server/blob/4.1.0/packages/node_modules/http-pouchdb/lib/index.js#L25
It should probably be using url.resolve() to safely build the final URL.
url.resolve()
The example in the readme:
Running the example verbatim,
localhost:5984
does not work. However,localhost:5984/
does work.See this line: https://github.com/pouchdb/pouchdb-server/blob/4.1.0/packages/node_modules/http-pouchdb/lib/index.js#L25
It should probably be using
url.resolve()
to safely build the final URL.