@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redhat-cloud-services/frontend-components-config",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Config plugins and settings for RedHat Cloud Services project.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -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/cloud-services-config/ci-beta/';
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 schema = await axios.get(requestUrl);
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(requestUrl);
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
- spawn('node', interceptorServerArgs, {
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,
@@ -38,10 +38,7 @@ const internalProxyRoutes = {
38
38
  ...routes,
39
39
  ...(interceptChromeConfig === true
40
40
  ? {
41
- '/beta/config': {
42
- host: 'http://localhost:9999',
43
- },
44
- '/config': {
41
+ '/api/chrome-service/v1/static': {
45
42
  host: 'http://localhost:9999',
46
43
  },
47
44
  }