How can I deploy my angular 2 app on tomcat or jboss?

和自甴很熟 提交于 2020-01-04 06:52:19

问题


I have built a basic angular 2 app. However I need to deploy it on Jboss or Tomcat as I need to use it along with my Java EE application.

Thanks for your help.


回答1:


You would use a bundler such as angular-cli or webpack to create the production bundle which is then served by the HTTP server. The bundler creates all required file that go into the htdocs directory. Normally Angular apps are completely decoupled from your backend server so there shouldn't be any JBoss or Tomcat specifics.

The Angular team are going to increasingly focus on angular-cli as the premier bundling solution so it might be a good idea to start there.




回答2:


If you are using angular-cli you can use ng build command. It creates all static files for deploy Angular2 app into the dist folder. You must copy and paste them in webresources folder of your Web Application (WAR). At the moment I am looking for how to deploy this files easier.



来源:https://stackoverflow.com/questions/37568145/how-can-i-deploy-my-angular-2-app-on-tomcat-or-jboss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!