Upload an angular project to a production server

0

I want to upload my angular project to a production server, but when I run

>> ng build --prod

It does not generate any errors

Your global Angular CLI version (7.0.3) is greater than your local
version (6.1.3). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

Date: 2018-11-01T16:05:43.076Z
Hash: 096eb3dcf5009220dbe2
Time: 34278ms
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.b00cb641b4deb8103af2.css (styles) 260 kB [initial] [rendered]
chunk {2} polyfills.945a753c7d5bef41f759.js (polyfills) 97.3 kB [initial] [rendered]
chunk {3} main.ddbaaa1d257c82ff16c5.js (main) 647 kB [initial] [rendered]

Then I copy the dist folder to the production server and change the respective links of js and css so that it can be called from miempresa.com/mi-proyecto-angular Achievement to show perfectly the idndex of the project but when I want to have access to the created components, por ejemplo "contacto" http://miempresa.com/mi-projecto-angular/contacto  I can not because it throws me a 404 error.

    
asked by Nahuel Jakobson 01.11.2018 в 17:41
source

1 answer

1

I still do not have enough reputation to comment, so I'll put it as an answer.

Put your index.html as follows:

<base href="./">

To recognize the components in your current route. If it does not work, show your index.html, and the error message that is coming out.

    
answered by 01.11.2018 в 17:51