Not running Angular 4 applicationon from Azure properly -
i working on angular 4 application. it's working fine on local machine. when ng serve serves application http://localhost:4200. since it's poc project therefore, there no api call fetching data assets/data.json file using services.
now deploy site azure. got dist folder when ran "ng build --env=prod". saw deployment succeeded message well.
but, when i'm running web site azure it's not loading properly. launched developer tool , see lots of 404 not found messages. attached screen shot.
i dont know why site not working properly. 1 more thing when go inside dist folder on local machine , run index.html page same error messages.
any appreciated. thanks.
to avoid these 404 errors, you'd need serve static json , woff files on azure creating web.config
file in wwwroot folder , put following mime config there.
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.webserver> <staticcontent> <remove fileextension=".json" /> <remove fileextension=".woff" /> <remove fileextension=".woff2" /> <mimemap fileextension=".json" mimetype="application/json" /> <mimemap fileextension=".woff" mimetype="application/font-woff" /> <mimemap fileextension=".woff2" mimetype="application/font-woff" /> </staticcontent> </system.webserver> </configuration>
Comments
Post a Comment