Adding SSH Keys for Private Git Repositories
When using a private Git repository with OVH hosting, it is essential to configure SSH keys to enable secure communication between your local machine and the server. This step is crucial because OVH requires SSH keys to authenticate connections with private repositories, ensuring that only authorized users can access and deploy code. To set up this connection, you need to generate an SSH key pair if you haven't already done so. Once generated, the public key must be added to your OVH account, while the private key is kept secure on your local machine. Always verify that the SSH keys are correctly configured to avoid deployment issues related to authentication.
Handling HTML File Naming Conventions
After setting up your project for deployment, another important step is to manage your HTML file naming properly. In certain server configurations, you may encounter an index.csr.html
file, which is generated as a result of the Angular SSR setup. It is essential to rename this file to index.html
before deploying it to your OVH server. This change is necessary because the web server looks for index.html
as the default file to serve when accessing the root directory of your application. By ensuring that the correct file is in place, you avoid potential issues related to serving your application’s entry point.
Addressing Prerender Issues with Angular SSR
When using Angular with Server-Side Rendering (SSR), especially with version 19 or later, prerendering can present unique challenges. These challenges often arise when routes need to be accessed through API calls rather than directly from the client. To mitigate prerender issues, it is vital to properly configure how your application handles API calls when serving routes. By setting up routes to be called through the server-side API, you ensure that the necessary data is available during the rendering process, allowing for a more seamless user experience. This approach not only improves the performance of your application but also simplifies the rendering logic, making it more robust and less prone to errors related to prerendering.