Files
archy/docker/justworks/business/public/assets/archipelago-paths.js
T

11 lines
489 B
JavaScript
Raw Normal View History

// Keep the unchanged Business UI's API requests in its isolated app namespace.
const businessFetch = window.fetch.bind(window);
window.fetch = (input, init) => {
const url = new URL(input instanceof Request ? input.url : input, location.href);
if (url.origin === location.origin && url.pathname.startsWith('/api/')) {
url.pathname = '/business-demo' + url.pathname;
input = input instanceof Request ? new Request(url, input) : url;
}
return businessFetch(input, init);
};