When completing your project build, it is essential to configure the server for handling angular routing. To do this effectively, refer to the following link: Angular - Deployment
For instance, in an Apache server, you must include the following code in the .htaccess
file:
RewriteEngine On
# Direct access to existing assets or directories
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# Use index.html if requested resource does not exist
RewriteRule ^ /index.html
This configuration ensures that page refreshes are handled correctly without losing the routing.