Deploy Angular 2 App with Webpack to Tomcat - 404 Errors

前端 未结 6 938
暖寄归人
暖寄归人 2020-12-01 14:50

I want to build and deploy my Angular 2 front end to a Tomcat application server. For getting started I\'ve followed exactly the steps of the following introduction: https:/

6条回答
  •  日久生厌
    2020-12-01 15:38

    If you are not using HashLocationStrategy so refresh will give you 404 for tomcat deployment. In such case you have to use web.xml for your solution and provide all your route to point to index.html. Here is the code snippets that you can apply for your path and then Angular routes will handle this.

    
        index
        /index.html
    
    
        index
        /home
    
    

    As suggested earlier by other configure your index.html(by ) to load the app.

提交回复
热议问题