-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconnection.js
More file actions
23 lines (22 loc) · 822 Bytes
/
connection.js
File metadata and controls
23 lines (22 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
* Gather connection options suitable for automated and manual testing
* of an off-the-shelf exist-db instance (e.g. in a CI environment)
* Allows overriding specific setting via environment variables.
*
* EXISTDB_SERVER - URL to the exist-db you want to connect to
* EXISTDB_USER - username of the user the queries should be executed with
* defaults to "admin"
* EXISTDB_PASS - password to authenticate EXISTDB_USER
* must be set for EXISTDB_USER to take effect
*/
/**
* @type {import('../util/connect.js').NodeExistConnectionOptions}
*/
import { readOptionsFromEnv } from '../index.js'
const envOptions = readOptionsFromEnv()
// test with admin user by default
if (!envOptions.basic_auth) {
envOptions.basic_auth = { user: 'admin', pass: '' }
}
// console.log(envOptions)
export { envOptions }