• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / #11898

pending completion
#11898

push

circleci

web-flow
Merge pull request #2770 from mozilla/license

Add license headers in source files

282 of 1138 branches covered (24.78%)

Branch coverage included in aggregate %.

959 of 3049 relevant lines covered (31.45%)

2.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/db/knexfile.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import pgConnectionStr from 'pg-connection-string'
6

7
import AppConstants from '../app-constants.js'
8
const { DATABASE_URL, NODE_ENV } = AppConstants
×
9
const connectionObj = pgConnectionStr.parse(DATABASE_URL)
×
10
if (NODE_ENV === 'heroku') {
×
11
  connectionObj.ssl = { rejectUnauthorized: false }
×
12
}
13

14
// For runtime, use DATABASE_URL
15
const RUNTIME_CONFIG = {
×
16
  client: 'postgresql',
17
  connection: connectionObj
18
}
19

20
// For tests, use test-DATABASE
21
const testConnectionObj = pgConnectionStr.parse(DATABASE_URL.replace(/\/(\w*)$/, '/test-$1'))
×
22
const TESTS_CONFIG = {
×
23
  client: 'postgresql',
24
  connection: testConnectionObj
25
}
26

27
let defaultConfig = {}
×
28
if (NODE_ENV === 'tests') {
×
29
  defaultConfig = TESTS_CONFIG
×
30
} else {
31
  defaultConfig = RUNTIME_CONFIG
×
32
}
33

34
export default defaultConfig
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc