After deploying my Angular app on Azure static web app, I encountered an error. Whenever I try to redirect to certain routes, it returns a 404 error. However, if I navigate from one route to another within the app, everything works fine. I have attempted to modify the baseRef in index.html with no luck. Locally, all functions as expected.
The deployment command ng build --prod
was used for deployment.
I utilized Linux as the server in Azure Static Web Apps, and the deployment process is defined in a yml file.
I referred to Microsoft's documentation but found it difficult to comprehend.
// CI/CD configuration using GitHub Actions
...
Here is the content of the angular.json
:
{
...
}
I created a web.config
, although its functionality remains unclear to me.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
...
Additionally, here is the index.html
located in the dist
directory:
<!doctype html>
<html lang="en">
<head>
...