Preserve hosted website UX inside Archipelago, add isolated Business and owner-authorized native wallet setup, and include deployment handoff. Based on main with native signer import already accepted.
11 lines
489 B
JavaScript
11 lines
489 B
JavaScript
// 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);
|
|
};
|