fix(client,tools): update proxy and location paths (#37106)

This commit is contained in:
mrugesh
2019-10-07 16:42:07 -07:00
committed by GitHub
parent 752a3d6d88
commit 4889e0fdc6
5 changed files with 27 additions and 25 deletions

View File

@ -3,22 +3,22 @@ const newsPlaceholderRE = /#\{\{NEWS\}\}/g;
const forumPlacehilderRE = /#\{\{FORUM\}\}/g;
exports.createRedirects = function createRedirects(locations) {
const { api, news, forum } = locations;
const { api, newsProxy, forumProxy } = locations;
if (!(api && news && forum)) {
if (!(api && newsProxy && forumProxy)) {
throw new Error(`One or more locations are missing, all are required.
api: ${api}
news: ${news}
forum: ${forum}
newsProxy: ${newsProxy}
forumProxy: ${forumProxy}
`);
}
return template
.replace(apiPlaceholderRE, api)
.replace(newsPlaceholderRE, news)
.replace(forumPlacehilderRE, forum);
.replace(newsPlaceholderRE, newsProxy)
.replace(forumPlacehilderRE, forumProxy);
};
/* eslint-disable max-len */