Skip to content

Commit

Permalink
Replaces the CouchDB port with default API port
Browse files Browse the repository at this point in the history
For importing/exporting settings we now use an API endpoint rather
than a couchapp route so we need to use the API port. This makes the
environment variable implementation equivalent to the default --local
and remote implementations which already use the API port.

#75
  • Loading branch information
garethbowen committed Aug 14, 2018
1 parent 6b1dc93 commit 7c54be5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bin/medic-conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ switch(args[0]) {
if(!process.env.COUCH_URL.match(/localhost/)) {
throw new Error(`You asked to configure a local instance, but the COUCH_URL env var is set to '${process.env.COUCH_URL}'. This may be a remote server.`);
}
instanceUrl = process.env.COUCH_URL.replace(/\/medic$/, '');
instanceUrl = process.env.COUCH_URL
.replace(/\/medic$/, '') // strip off the database
.replace(/:5984/, ':5988'); // use api port instead of couchdb
info('Using instance URL from COUCH_URL environment variable.');
} else {
instanceUrl = 'http://admin:pass@localhost:5988';
Expand Down

0 comments on commit 7c54be5

Please sign in to comment.