fix: Export news location from env
This commit is contained in:
committed by
mrugesh mohapatra
parent
0369dfbf37
commit
e3d4764ff5
@ -26,7 +26,7 @@ IMAGE_BASE_URL='https://s3.amazonaws.com/freecodecamp/images/'
|
|||||||
HOME_LOCATION='http://localhost:8000'
|
HOME_LOCATION='http://localhost:8000'
|
||||||
API_LOCATION='http://localhost:3000'
|
API_LOCATION='http://localhost:3000'
|
||||||
FORUM_LOCATION='https://forum.localhost'
|
FORUM_LOCATION='https://forum.localhost'
|
||||||
FORUM_PROXY_LOCATION='https://proxy.localhost'
|
NEWS_LOCATION='https://news.localhost/latest'
|
||||||
LOCALE=english
|
LOCALE=english
|
||||||
|
|
||||||
TEST_CHALLENGES_FOR_LANGS=english
|
TEST_CHALLENGES_FOR_LANGS=english
|
||||||
|
@ -13,7 +13,12 @@ const log = debug('fcc:tools:ensure-env');
|
|||||||
|
|
||||||
const { NODE_ENV } = process.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 apiPath = path.resolve(__dirname, '../../api-server');
|
||||||
const clientPath = path.resolve(__dirname, '../../client');
|
const clientPath = path.resolve(__dirname, '../../client');
|
||||||
@ -21,7 +26,7 @@ const clientStaticPath = path.resolve(clientPath, 'static');
|
|||||||
const globalConfigPath = path.resolve(__dirname, '../../config');
|
const globalConfigPath = path.resolve(__dirname, '../../config');
|
||||||
|
|
||||||
if (NODE_ENV === 'production') {
|
if (NODE_ENV === 'production') {
|
||||||
const redirects = createRedirects({ api, home, forum });
|
const redirects = createRedirects({ api, news, forum });
|
||||||
fs.writeFile(`${clientStaticPath}/_redirects`, redirects, function(err) {
|
fs.writeFile(`${clientStaticPath}/_redirects`, redirects, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
log('Error');
|
log('Error');
|
||||||
|
Reference in New Issue
Block a user