Deploy AngularJS app on tomcat
Asked Answered
C

1

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?

Contented answered 18/11, 2015 at 16:44 Comment(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?Eddings
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"Contented
P
12

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

Cheers!!

Passade answered 18/11, 2015 at 19:5 Comment(7)
Ok, it messed up some CSS and references, but in principle this works. Thank you!Contented
Let me if you still face any problem in future. Thanks for marking my question correctPassade
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". thanksShutter
is there any message about permission denied?Passade
How we can deploy it over the network, I mean on another tomcat server?Mirellamirelle
use same tactics that you done for deploying on first tomcatPassade
How can we deploy projects with node module dependencies.Picrate

© 2022 - 2024 — McMap. All rights reserved.