Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test config picks up host (and admin credentials) from master config
- Loading branch information
Showing
1 changed file
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
var fs = require('fs'), | ||
path = require("path"), | ||
configPath = path.join(__dirname, "..","config.json"), | ||
ok = false, | ||
config = fs.readFileSync(configPath, "utf8"); | ||
|
||
try { | ||
config = JSON.parse(config); | ||
ok = true; | ||
} catch (e) { | ||
console.error("could not read config.json, please use `npm start syncpoint` to set up your installation: "+configPath); | ||
} | ||
|
||
// we use the configured host but test databases. | ||
// if there is a test_host configured we use that instead | ||
module.exports = { | ||
"host" : "http://Administrator:ok@localhost:5984", | ||
"host" : config.test_host || config.host, | ||
"admin_db" : "test_sp_admin", | ||
"users_db" : "test_sp_users" | ||
} |