@redhat-cloud-services/frontend-components-config 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ const bundles = Array.from(
|
|
|
27
27
|
const app = express();
|
|
28
28
|
const port = 9999;
|
|
29
29
|
|
|
30
|
-
const BASE_URL = 'https://raw.githubusercontent.com/RedHatInsights/
|
|
30
|
+
const BASE_URL = 'https://raw.githubusercontent.com/RedHatInsights/chrome-service-backend/main';
|
|
31
31
|
|
|
32
32
|
function getRequestBundle(requestUrl) {
|
|
33
33
|
const bundle = requestUrl.split('/').pop().split('-').shift();
|
|
@@ -35,14 +35,11 @@ function getRequestBundle(requestUrl) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
app.get('*', async (req, res, next) => {
|
|
38
|
-
let requestUrl = `${BASE_URL}${req.url.replace(/(\/beta)?\/config/gm, '')}`;
|
|
39
|
-
if (requestUrl.includes('insights-navigation.json')) {
|
|
40
|
-
requestUrl = requestUrl.replace('insights-navigation.json', 'rhel-navigation.json');
|
|
41
|
-
}
|
|
42
38
|
try {
|
|
43
|
-
const
|
|
39
|
+
const reqUrl = BASE_URL + req.url.replace('/api/chrome-service/v1', '');
|
|
40
|
+
const schema = await axios.get(reqUrl);
|
|
44
41
|
if (req.url.includes('-navigation.json') && bundles.some((bundle) => req.url.includes(bundle))) {
|
|
45
|
-
const requestBundle = getRequestBundle(
|
|
42
|
+
const requestBundle = getRequestBundle(req.url);
|
|
46
43
|
/** handle nav json */
|
|
47
44
|
const payload = schema.data;
|
|
48
45
|
payload.navItems = [...payload.navItems, ...navItems.filter(({ href }) => href.includes(requestBundle))];
|
|
@@ -69,7 +69,8 @@ async function devScript(argv, cwd) {
|
|
|
69
69
|
if (fecConfig.interceptChromeConfig === true) {
|
|
70
70
|
const interceptorServerPath = resolve(__dirname, './csc-interceptor-server.js');
|
|
71
71
|
const interceptorServerArgs = [interceptorServerPath];
|
|
72
|
-
|
|
72
|
+
// Ensure ipv4 DNS is hit first. Currently there are issues with IPV4
|
|
73
|
+
spawn('NODE_OPTIONS=--dns-result-order=ipv4first node', interceptorServerArgs, {
|
|
73
74
|
stdio: [process.stdout, process.stdout, process.stdout],
|
|
74
75
|
cwd,
|
|
75
76
|
shell: true,
|