Deploy Angular 2 App with Webpack to Tomcat - 404 Errors

前端 未结 6 940
暖寄归人
暖寄归人 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:30

    I had a similar situation. The front-end app was ready using angular-2 and webpack and I wanted to deploy it on tomcat server. I followed the following steps:

    1. Run command “ng build --prod --bh /[URL you want to extend for production]” on your Angular 2 project folder.

    2. It will create dist folder in your angular2 app & 'your-project-name' from step 1 will be used on the tomcat server URL.

    3. Copy all the files of newly created dist folder & paste them in webapps folder of Java application.

    4. Create war file.

    5. Deploy that war on server.

    Hope it helps!

提交回复
热议问题