Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
23 lines
554 B
JavaScript
23 lines
554 B
JavaScript
'use strict'
|
|
|
|
// Everything that cannot be checked in but is useful server-side is stored in
|
|
// a JSON data file: private/secret.json.
|
|
|
|
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const secretsPath = path.join(__dirname, '..', 'private', 'secret.json')
|
|
|
|
if (fs.existsSync(secretsPath)) {
|
|
try {
|
|
module.exports = require(secretsPath)
|
|
} catch (e) {
|
|
console.error(`Error loading secret data: ${e.message}`)
|
|
process.exit(1)
|
|
}
|
|
} else {
|
|
console.warn(
|
|
`No secret data found at ${secretsPath} (see lib/server-secrets.js)`
|
|
)
|
|
}
|