2

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

3 Answers 3

2

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!

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.