Files
shields/lib/server-secrets.js
Paul Melnikow f271b82670 Nudge forward style checks a la eslint-config-standard (#1082)
Because I despise nitpicking stuff like indentation and spacing in pull request comments, I'd like to nudge forward our automated style checking, at least for new files being added.

I don't want to totally rewrite server.js just to get automated style checking… the blame tracking is just too useful. So let's it's just take care of that when we start splitting it out.

More discussion in #948.
2017-10-01 21:09:43 -04:00

21 lines
553 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)`);
}