ladariha
ladariha
Sep 3, 2018 · 1 min read

What about composing the SPA using JS “files” served by API servers? So there would be a app shell, and it would download JS sources from each API server (API gateway could be used for discovery of API servers). So it would look like:

App shell: Hey API gateway, get me API definitions

API gateway: [{src: “api.domain2.com/src.js”}, {src: “api.domain2.com/src.js”}]
App Shell : scripts.forEach(fetch)

Now app shell has loaded all scripts and their origin is their particular API server (aka the same)? Could be tricky to resolve the script loading from various domains (cache and service worker could help)

    ladariha

    Written by

    ladariha