Rajan Desai
Rajan Desai

Reputation: 79

how to run angular 4.6 application in Apache- tomcat server?

i'm new at angular 4.6, my Question is about how to run angular 4 application using Apache-tomcat server.

Upvotes: 2

Views: 3609

Answers (3)

Laxmikant Dange
Laxmikant Dange

Reputation: 7688

If you are using Angular CLI, you need to use

ng build --bh /appName/

If you are deploying for production, use --prod. When you use production parameter to build, angular uses production configurations like AOT.

for ref you can follow angular cli docs.

Upvotes: 1

Himanshu
Himanshu

Reputation: 855

Build project like: ng build --prod --aot *AOT is ahead of time compilation in angular.

Then in index.html in dist folder change href="/" to "./".

Then copy all the files to a folder(YOUR_APP_NAME) inside webapps folder and you are good to go.

Also, you can create your web.xml file inside WEB_INF directory for your application specific settings like errors, accessibility etc.

Upvotes: 1

Padmapriya Vishnuvardhan
Padmapriya Vishnuvardhan

Reputation: 2166

Go to our app and run below command.

ng build --base-href=/angular/

http://www.thejavageek.com/2018/01/04/deploying-angular-app-tomcat/

Hope this will help you!

Upvotes: 2

Related Questions