Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

469
Visualizações
How to run angular application running on single instance from different domains

I have deployed the angular application which is running fine in production with url

http://example.com/my-project

Now we have requirement where we want to run this application from different domain with extra subdomain like

http://exa1.com/**abc**/my-project

When we run the application from dns http://exa1.com/my-project, application runs fine.

But when we are including additional sub domain like abc in between dns and project name then scripts does not loads and start giving 404 not found error.

I tried appending this additional sub domain in base href in index.html like

<base href="/abc/">

Also I have tried

 <script type="text/javascript">
   
   var url = location.href; 
   
    let str=url;
    str=str.substring(0,str.indexOf("my-project"))+'/my-project';
    
    
    var base = document.createElement('base');

    base.href = str;
    document.getElementsByTagName('head')[0].appendChild(base);

    </script>

<base href="/">

But did not succeed.

Kindly guide me further to solve this.

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda