mirror of
https://github.com/microsoft/TypeScript-Node-Starter.git
synced 2026-05-07 13:56:06 +00:00
found a better config setup I like
This commit is contained in:
@@ -14,9 +14,6 @@ import * as expressValidator from "express-validator";
|
||||
import * as bluebird from "bluebird";
|
||||
import { MONGODB_URI, SESSION_SECRET } from "./util/loadSecrets";
|
||||
|
||||
console.log(MONGODB_URI);
|
||||
console.log(SESSION_SECRET);
|
||||
|
||||
const MongoStore = mongo(session);
|
||||
|
||||
// Controllers (route handlers)
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
// import log from './logger'; TODO
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
export const ENVIRONMENT = process.env.NODE_ENV;
|
||||
const prod = ENVIRONMENT === "production";
|
||||
const prod = ENVIRONMENT === "production"; // Anything else is treated as 'dev'
|
||||
|
||||
dotenv.config({ path: ".env.example" });
|
||||
|
||||
export const SESSION_SECRET = process.env["SESSION_SECRET"];
|
||||
export const MONGODB_URI = prod ? process.env["MONGODB_URI"] : process.env["MONGODB_URI_LOCAL"];
|
||||
|
||||
Reference in New Issue
Block a user