I've just deployed my angular app to azure by running an ng build --prod and pushing it to git but I get a 404 error saying that it cannot find my json file I have in the assets folder.
I've also tried running ng build --prod --base-href "./" but I'm till getting the same error.
I'm currently trying to get the files in an api service like this:
return this.http.get('../assets/exercises.json')
but when I run the website on azure I get a 404 error
Failed to load resource: the server responded with a status of 404 (Not Found)
You need to add your own web.config.Its in the documentation of Angular: https://angular.io/guide/deployment
<staticContent><mimeMap fileExtension=".json" mimeType="application/json" /></staticContent>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With