angular serve index.html from other origin than rest of application

Discussão em 'Angular' iniciado por UncleBob, Fevereiro 11, 2025.

  1. UncleBob

    UncleBob Guest

    This is a bit of an exotic question, and maybe it's completely impossible.

    The idea is this: I'd like to serve the index.html from another domain than the rest of the applications code. So you'd go to mydomain.com/application and you'd get an index.html, but the css, javascript aso files would be delivered from another domain or subdomain, like cdn.mydomain.com.

    If you want to know why exactly I'm interested in building such a contraption, that's explained in this question.

    At first, I thought this should be fairly easy... change the html head to another domain, and you're good to go. But it doesn't work. All files are loaded without error, I can even quickly see the background color of my theme, then the window goes blank and does nothing anymore. I don't understand why, if all the code is there, why does it matter where it is from? There are no errors thrown either, no html statuses in the network log other than 200, all files listed in the html are received. But in the window, there's just... nothing.

    Does anybody have any idea how this could be achieved?

    Continue reading...

Compartilhe esta Página