fix: Export news location from env

This commit is contained in:
Bouncey
2019-02-05 22:08:37 +00:00
committed by mrugesh mohapatra
parent 0369dfbf37
commit e3d4764ff5
2 changed files with 8 additions and 3 deletions

View File

@ -26,7 +26,7 @@ IMAGE_BASE_URL='https://s3.amazonaws.com/freecodecamp/images/'
HOME_LOCATION='http://localhost:8000'
API_LOCATION='http://localhost:3000'
FORUM_LOCATION='https://forum.localhost'
FORUM_PROXY_LOCATION='https://proxy.localhost'
NEWS_LOCATION='https://news.localhost/latest'
LOCALE=english
TEST_CHALLENGES_FOR_LANGS=english

View File

@ -13,7 +13,12 @@ const log = debug('fcc:tools:ensure-env');
const { NODE_ENV } = process.env;
const { homeLocation: home, apiLocation: api, forumLocation: forum, locale } = env;
const {
apiLocation: api,
forumLocation: forum,
locale,
newsLocation: news
} = env;
const apiPath = path.resolve(__dirname, '../../api-server');
const clientPath = path.resolve(__dirname, '../../client');
@ -21,7 +26,7 @@ const clientStaticPath = path.resolve(clientPath, 'static');
const globalConfigPath = path.resolve(__dirname, '../../config');
if (NODE_ENV === 'production') {
const redirects = createRedirects({ api, home, forum });
const redirects = createRedirects({ api, news, forum });
fs.writeFile(`${clientStaticPath}/_redirects`, redirects, function(err) {
if (err) {
log('Error');