8

I created an AngularJS app with the yeoman angular generator. Now I want to host it using Apache tomcat.

I already ran "grunt build" and have all my assets ready in the "dist"-folder. Is there a way to create a .war-file or can I just copy the files to a folder inside tomcat?

2
  • Hi, I landed up on the same issue and found this post. Were you able to get this fixed? Does copying the contents in web apps dir works for you? As it messes my relative URLs for js and CSS load. did you faced this issue too? Commented Jun 10, 2016 at 3:54
  • 1
    No I just had to do a "grunt build" and copy the contents from my "dist" folder into a new folder within tomcat's "webapps" folder. If I would just copy the "dist" folder into the webapps directory I could access my app via "http://<servername>:<port>/dist" Commented Jun 10, 2016 at 7:25

1 Answer 1

12

Just copy paste your all files in your project folder e.g. $TOMCAT_PATH/webapps/your-project-root/

Cheers!!

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

7 Comments

Ok, it messed up some CSS and references, but in principle this works. Thank you!
Let me if you still face any problem in future. Thanks for marking my question correct
hi Martin, how were you able to resolve the references? i tried dist/...js...but it says "failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH". thanks
is there any message about permission denied?
How we can deploy it over the network, I mean on another tomcat server?
|

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.