Repository URL to install this package:
|
Version:
2.0.11 ▾
|
import { getURL, callDetails } from './proxyPathConfigs'
import { getBaseTargetURL } from '../../deps/transformRequestProxy'
import { urls } from './index'
// export const virtualized = {
// cartAndCheckout: {
// cart: `${cartAndCheckoutBaseUrl}/cartservice/bags/user`,
// items: `${cartAndCheckoutBaseUrl}/cartservice/bags/user/items`,
// promos: `${cartAndCheckoutBaseUrl}/cartservice/bags/user/promos`,
// promocode: `${cartAndCheckoutBaseUrl}/cartservice/bags/user/promos/promocode`,
// payments: `${cartAndCheckoutBaseUrl}/cartservice/bags/user/payments`,
// checkout: `${cartAndCheckoutBaseUrl}/checkoutservice/orders/user`,
// },
// }
// if (process.env.DEBUG_CLIENT_REQUEST_APIS || true) {
Object.keys(urls).forEach(key => {
const url = urls[key]
console.log({ [key]: url })
if (url.includes('/api/')) {
const afterApi = url.split('/api').pop()
const methodCallType = callDetails[afterApi]
const proxyApiOriginal = getURL(afterApi, methodCallType)
const proxyApi = getBaseTargetURL(afterApi)
console.log({ afterApi, proxyApiOriginal, proxyApi, methodCallType })
urls[key] = proxyApi
}
})
// }
console.log({ urls })