Skip to content

Commit

Permalink
removing the URLs changes
Browse files Browse the repository at this point in the history
Signed-off-by: sj895092 <[email protected]>
  • Loading branch information
Shobhajayanna committed Dec 2, 2024
1 parent 6875f5d commit 52693e6
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions api-catalog-ui/frontend/src/helpers/urls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,20 @@ const getBaseUrl = (pEnvironment, pLocation) => {

// Going through the Gateway
const urlParts = location.pathname.split('/');

if(urlParts[1]==="apicatalog") {
if (urlParts[2] === 'ui') {
return `${location.protocol}//${location.host}/${urlParts[1]}/api/${urlParts[3]}`;
}
} else {
if (urlParts[3] === 'ui') {
return `${location.protocol}//${location.host}/${urlParts[1]}${urlParts[2]}/api/${urlParts[4]}`;
}
if (urlParts[2] === 'ui') {
return `${location.protocol}//${location.host}/${urlParts[1]}/api/${urlParts[3]}`;
}

// Testing environment
if (environment.REACT_APP_GATEWAY_URL && environment.REACT_APP_CATALOG_HOME) {
return `${environment.REACT_APP_GATEWAY_URL}${environment.REACT_APP_CATALOG_HOME}`;
}

// Local development environment
if (environment.REACT_APP_CATALOG_HOME) {
if(urlParts[1]!== "apicatalog") {
return `${location.protocol}//${location.host}/${urlParts[1]}${environment.REACT_APP_CATALOG_HOME}`;
}
return `${location.protocol}//${location.host}${environment.REACT_APP_CATALOG_HOME}`;
}

// Standalone access to the Catalog
return location.href;
};
Expand Down

0 comments on commit 52693e6

Please sign in to comment.