I am creating a CouchApp and have a question about remote databases and creating a PouchDB object.
I currently create a new PouchDB object using:
var db = new PouchDB('htps://username.cloudant.com/database');
But I would rather instantiate it as:
var db = new PouchDB('/database');
or
var db = new PouchDB('database');
My guess is that PouchDB sees this as a local database instead of a remote database. Is my thinking correct, and how can I get my desired result? I want to strip the hostname of the URL because I want to keep everything portable and replicate it over other servers.
Since you defined a vhost, you can use the following workaround mabye :
var url = new URL(window.location.href);
var host = url.host;
var db = new PouchDB(host+"/database");