How to publish an Angular CLI project to my server?

0

I have a project in Angularjs running localhost perfectly. I'm trying to host on the server " HOSTGATOR " and I'm not succeeding.
I'm building Build with the Angle CLI and Hosting the Dir " Dist " in the " www." When trying to access index.html the following errors occur:

Falha no carregamento do <script> com a fonte “http://site.com.br/runtime.a66f828dca56eeb90e02.js”.<br>
Falha no carregamento do <script> com a fonte “http://site.com.br/polyfills.2f4a59095805af02bd79.js”.<br>
Falha no carregamento do <script> com a fonte “http://site.com.br/main.5d52293f160730f348fe.js”.

Then I play all files, including index.html , in the root www. Thus, when accessing index.html , it only displays the welcome page of Angular. " Welcome to app! "

Can anyone help me?

Thank you ...

    
asked by anonymous 18.06.2018 / 14:44

1 answer

0

First check that when you build your href is according to what you expect. If it is direct from the site for example

site.com.br   ## não precisa do href

If you want to do something like this

site.com.br/app  ## use ng build --base-href=/app

Another important point is that you have to configure your server to redirect all routes to index.html. In the documentation has explaining by the most popular servers.

link

    
18.06.2018 / 16:04