osu-capstone-cs72 / cs-applied-plan-portal

A portal that streamlines the planning process for OSU CS Applied students and advisors
https://applied-plan-portal.herokuapp.com
MIT License
2 stars 5 forks source link

Change configurations based on environment #80

Closed philectron closed 4 years ago

philectron commented 4 years ago

There are several parts of the code that we use for development, such as the dotenv package. We would like to wrap these part in a conditional statement that checks against the current environment. For example, in server.js,

if (app.get("ENV") !== "PRODUCTION") {
  require("dotenv").config();
}

As seen above, we'd only want to use the dotenv package to read environment variable from a git-ignored file .env when we're on development mode. If we are on production, we shouldn't have to do this; instead, we should config the variables directly on Heroku's dashboard and let the deployed app use it.

There may be other parts of the code that behave like the example above, and so we need to branch them according to the environment.