Echo JS 0.11.0

<~>

tracker1 774 days ago. link 1 point
I usually have a default api root path... defaulted to /api... then I proxy /api in my dev host to my ui api instance... on deployed serviers/services, it's similar, where the load balancer will reroute the /api base path... or /api/v1.0.0/ etc in larger apps.

Often creating a tightly coupled api service for the UI, separated from any data services behind that.

I also set it to look for globalThis.__API_BASE__ that can be injected into *.html at build or deploy for other environments where a reverse-proxy is either a bad idea (S3, etc).

Beyond this, when the loading takes more than a second, I'll have the default html (especially in SPA) render a loader div along with the css for that loader... This renders the first part quickly, while being able to run updates as other pieces dynamically load in the beginning.  /api/v.../features as an example, that is feature flags and config options that will inform other loaded items... dynamically loaded components, for example.