Files
shields/lib/server-secrets.js
Paul Melnikow 7a664ca3e8 Run prettier (#1866)
Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
2018-08-08 17:57:14 -04:00

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)`
)
}