freeCodeCamp/config/env.js

32 lines
648 B
JavaScript
Raw Normal View History

const path = require('path');
2019-08-18 19:49:40 +00:00
if (process.env.FREECODECAMP_NODE_ENV !== 'production') {
const envPath = path.resolve(__dirname, '../.env');
require('dotenv').config({ path: envPath });
}
const {
HOME_LOCATION: home,
API_LOCATION: api,
FORUM_LOCATION: forum,
2019-02-05 20:28:45 +00:00
NEWS_LOCATION: news,
LOCALE: locale,
STRIPE_PUBLIC: stripePublicKey,
ALGOLIA_APP_ID: algoliaAppId,
ALGOLIA_API_KEY: algoliaAPIKey
} = process.env;
const locations = {
homeLocation: home,
apiLocation: api,
2019-02-05 20:28:45 +00:00
forumLocation: forum,
newsLocation: news
};
module.exports = Object.assign(locations, {
locale,
stripePublicKey,
algoliaAppId,
algoliaAPIKey
});