1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2026-03-24 02:43:03 +00:00

have env var scripts.. but I'm not sure I like it

This commit is contained in:
Bowden
2018-01-04 16:16:00 -08:00
parent 958d0f5e4b
commit 7974d20503
6 changed files with 71 additions and 10 deletions

34
src/util/loadSecrets.ts Normal file
View File

@@ -0,0 +1,34 @@
// import log from './logger'; TODO
export const ENVIRONMENT = process.env.NODE_ENV;
const prod = ENVIRONMENT === "production";
export const SESSION_SECRET = process.env["SESSION_SECRET"];
export const MONGODB_URI = prod ? process.env["MONGODB_URI"] : process.env["MONGODB_URI_LOCAL"];
// if (!GITHUB_CLIENT_SECRET) {
// log.fatal("ERROR\tNo client secret. Set TCQ_GH_SECRET.");
// process.exit(1);
// }
// if (!GITHUB_CLIENT_ID) {
// log.fatal("ERROR\tNo client id. Set TCQ_GH_ID.");
// process.exit(1);
// }
// if (!SESSION_SECRET) {
// log.fatal("ERROR\tNo session secret. Set TCQ_SESSION_SECRET.");
// process.exit(1);
// }
// if (!CDB_SECRET) {
// log.fatal("ERROR\tNo CosmosDB secret. Set TCQ_CDB_SECRET.");
// process.exit(1);
// }
// if (!AI_IKEY) {
// log.fatal("ERROR\tNo Application Insights Instrumentation Key. Set TCQ_AI_IKEY.");
// process.exit(1);
// }