Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
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 })